[572074] Constraint gmf.runtime range for Sirius integration
[EMFCompare2.git] / releng / org.eclipse.emf.compare.releng / publish-milestone.sh
blob9daf16112eacac4d3329fe4f7d10f5543aa3e116
1 #!/bin/sh
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
9 # Contributors:
10 # Obeo - initial API and implementation
11 # ====================================================================
13 # Exit on error
14 set -e
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}$ ]]
26 then
27 echo "$QUALIFIER doesn't match the expect format x.x.x.yyyyMMddhhmm"
28 exit 1
31 if ssh ${SSH_ACCOUNT} "[ ! -d ${NIGHTLIES_FOLDER}/${QUALIFIER} ]"
32 then
33 echo "couldn't find build with qualifier $QUALIFIER in the promoted nightlies"
34 exit 1
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} ]"
46 then
47 UPDATE_ROOT_COMPOSITE=true
50 ssh ${SSH_ACCOUNT} << EOSSH
51 if ${UPDATE_ROOT_COMPOSITE}
52 then
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} ]
63 then
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 *
71 popd
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
77 version = 1
78 metadata.repository.factory.order = compositeContent.xml,\!
79 artifact.repository.factory.order = compositeArtifacts.xml,\!
80 EOF
81 chgrp -R ${GROUP} ${MILESTONES_FOLDER}/${VERSION_SHORT}/S${TIMESTAMP}/p2.index
82 EOSSH
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 ]
90 #then
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}
93 #fi