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 # ====================================================================
16 # The SSH account to use
17 export SSH_ACCOUNT
="genie.emfcompare@projects-storage.eclipse.org"
19 NIGHTLIES_FOLDER
="/home/data/httpd/download.eclipse.org/modeling/emf/compare/updates/nightly"
20 MILESTONES_FOLDER
="/home/data/httpd/download.eclipse.org/modeling/emf/compare/updates/milestones"
21 DROPS_FOLDER
="/home/data/httpd/download.eclipse.org/modeling/emf/compare/downloads/drops"
22 ZIP_PREFIX
="emf-compare-update-"
23 GROUP
="modeling.emfcompare"
25 if [[ ! ${QUALIFIER} =~ ^
[0-9]\.
[0-9]\.
[0-9]+\.
[0-9]{12}$
]]
27 echo "$QUALIFIER doesn't match the expect format x.x.x.yyyyMMddhhmm"
31 if ssh ${SSH_ACCOUNT} "[ ! -d ${NIGHTLIES_FOLDER}/${QUALIFIER} ]"
33 echo "couldn
't find build with qualifier $QUALIFIER in the promoted nightlies"
37 echo "promoting build $QUALIFIER as milestone $ALIAS"
39 IFS=. read MAJOR MINOR MICRO TIMESTAMP <<<"${QUALIFIER}"
41 VERSION_SHORT=${MAJOR}.${MINOR}
42 VERSION=${MAJOR}.${MINOR}.${MICRO}
44 UPDATE_ROOT_COMPOSITE=false
45 if ssh ${SSH_ACCOUNT} "[ ! -d ${MILESTONES_FOLDER}/${VERSION_SHORT} ]"
47 UPDATE_ROOT_COMPOSITE=true
50 ssh ${SSH_ACCOUNT} << EOSSH
51 if ${UPDATE_ROOT_COMPOSITE}
53 mkdir -p ${MILESTONES_FOLDER}/${VERSION_SHORT}
54 chgrp ${GROUP} ${MILESTONES_FOLDER}/${VERSION_SHORT}
57 ## copy the nightly to its "milestones" location
58 cp -r ${NIGHTLIES_FOLDER}/${QUALIFIER} ${MILESTONES_FOLDER}/${VERSION_SHORT}/S${TIMESTAMP}
59 chgrp -R ${GROUP} ${MILESTONES_FOLDER}/${VERSION_SHORT}/S${TIMESTAMP}
61 ## Create a compressed archive of this repository and place it in the drops folder
62 if [ ! -d ${DROPS_FOLDER}/${VERSION} ]
64 mkdir -p ${DROPS_FOLDER}/${VERSION}
65 chgrp ${GROUP} ${DROPS_FOLDER}/${VERSION}
68 mkdir -p ${DROPS_FOLDER}/${VERSION}/S${TIMESTAMP}
69 pushd ${MILESTONES_FOLDER}/${VERSION_SHORT}/S${TIMESTAMP}
70 zip -2 -r ${DROPS_FOLDER}/${VERSION}/S${TIMESTAMP}/${ZIP_PREFIX}${ALIAS}.zip *
72 md5sum ${DROPS_FOLDER}/${VERSION}/S${TIMESTAMP}/${ZIP_PREFIX}${ALIAS}.zip > ${DROPS_FOLDER}/${VERSION}/S${TIMESTAMP}/${ZIP_PREFIX}${ALIAS}.zip.md5
73 chgrp -R ${GROUP} ${DROPS_FOLDER}/${VERSION}/S${TIMESTAMP}
75 ## Create the p2.index file for this milestone
76 cat <<EOF >${MILESTONES_FOLDER}/${VERSION_SHORT}/S${TIMESTAMP}/p2.index
78 metadata.repository.factory.order = compositeContent.xml,\!
79 artifact.repository.factory.order = compositeArtifacts.xml,\!
81 chgrp -R ${GROUP} ${MILESTONES_FOLDER}/${VERSION_SHORT}/S${TIMESTAMP}/p2.index
84 ## Update the composite update site with this new child
86 #cd ${MILESTONES_FOLDER}/${VERSION_SHORT}
87 #/shared/common/apache-ant-latest/bin/ant -f /shared/modeling/tools/promotion/manage-composite.xml add -Dchild.repository=S${TIMESTAMP}
89 #if [ "$UPDATE_ROOT_COMPOSITE" = true ]
91 # cd ${MILESTONES_FOLDER}
92 # /shared/common/apache-ant-latest/bin/ant -f /shared/modeling/tools/promotion/manage-composite.xml add -Dchild.repository=${VERSION_SHORT}