2 # ====================================================================
3 # Copyright (c) 2021 Obeo
4 # This program and the accompanying materials
5 # are made available under the terms of the Eclipse Public License 2.0
6 # which accompanies this distribution, and is available at
7 # https://www.eclipse.org/legal/epl-2.0
10 # Obeo - initial API and implementation
11 # ====================================================================
13 if [ ${REFERENCE_TARGET_PLATFORM} != ${PLATFORM} ]; then
20 # The SSH account to use
21 export SSH_ACCOUNT
="genie.emfcompare@projects-storage.eclipse.org"
23 NIGHTLIES_FOLDER
="/home/data/httpd/download.eclipse.org/modeling/emf/compare/updates/nightly"
24 GROUP
="modeling.emfcompare"
26 CORE_UPDATE_FOLDER
=${WORKSPACE}/packaging
/org.eclipse.emf.compare.update
/target
27 EXTRAS_UPDATE_FOLDER
=${WORKSPACE}/packaging
/org.eclipse.emf.compare.update.extras
/target
29 CORE_UPDATE_ZIP
="$(ls ${CORE_UPDATE_FOLDER}/org.eclipse.emf.compare-*.zip | sort -V | tail -n1)"
30 EXTRAS_UPDATE_ZIP
="$(ls ${EXTRAS_UPDATE_FOLDER}/org.eclipse.emf.compare.extras-*.zip | sort -V | tail -n1)"
32 CORE_ZIP_NAME
=$
(echo ${CORE_UPDATE_ZIP} |
sed 's/.*\(org.eclipse.emf.compare-.*.zip\)$/\1/')
33 EXTRAS_ZIP_NAME
=$
(echo ${EXTRAS_UPDATE_ZIP} |
sed 's/.*\(org.eclipse.emf.compare.extras-.*.zip\)$/\1/')
34 QUALIFIER
=$
(echo ${CORE_UPDATE_ZIP} |
sed 's/.*org.eclipse.emf.compare-\(.*\).zip$/\1/')
36 P2_TIMESTAMP
=$
(date +"%s000")
38 ssh "${SSH_ACCOUNT}" mkdir -p ${NIGHTLIES_FOLDER}/${QUALIFIER}
39 scp -rp ${CORE_UPDATE_ZIP} ${EXTRAS_UPDATE_ZIP} "${SSH_ACCOUNT}:${NIGHTLIES_FOLDER}/${QUALIFIER}"
41 # make a composite with both "core" and "extras" features
42 cat > compositeArtifacts.xml
<<EOF
43 <?xml version='1.0' encoding='UTF-8'?>
44 <?compositeArtifactRepository version='1.0.0'?>
45 <repository name='Eclipse EMF Compare ${QUALIFIER}' type='org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository' version='1.0.0'>
47 <property name='p2.timestamp' value='${P2_TIMESTAMP}'/>
50 <child location='core'/>
51 <child location='extras'/>
55 cat > compositeContent.xml
<<EOF
56 <?xml version='1.0' encoding='UTF-8'?>
57 <?compositeMetadataRepository version='1.0.0'?>
58 <repository name='Eclipse EMF Compare ${QUALIFIER}' type='org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository' version='1.0.0'>
60 <property name='p2.timestamp' value='${P2_TIMESTAMP}'/>
63 <child location='core'/>
64 <child location='extras'/>
69 # push this composite to the download area as well
70 scp
-rp compositeArtifacts.xml compositeContent.xml
"${SSH_ACCOUNT}:${NIGHTLIES_FOLDER}/${QUALIFIER}"
72 ssh "${SSH_ACCOUNT}" -T <<EOF
73 pushd ${NIGHTLIES_FOLDER}/${QUALIFIER}
74 unzip "${CORE_ZIP_NAME}" -d core/
75 unzip "${EXTRAS_ZIP_NAME}" -d extras/
80 # make sure permissions are update for the emfcompare group
81 chgrp -R ${GROUP} ${NIGHTLIES_FOLDER}/${QUALIFIER}
82 chmod -R g+w ${NIGHTLIES_FOLDER}/${QUALIFIER}
84 pushd ${NIGHTLIES_FOLDER}/latest
86 cp -r ../${QUALIFIER}/* .