From 69bd1cb4cfcdfb876d4d878510cb397981ba07b0 Mon Sep 17 00:00:00 2001 From: Jonah Graham Date: Fri, 8 Sep 2023 12:07:05 -0400 Subject: [PATCH] Add cdt-lsp support to the promote-a-build scripts Part of https://github.com/eclipse-cdt/cdt-lsp/issues/197 --- releng/promote-a-build.Jenkinsfile | 7 ++++--- releng/scripts/promote-a-build.sh | 17 +++++++++++++---- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/releng/promote-a-build.Jenkinsfile b/releng/promote-a-build.Jenkinsfile index e6cc8fa0111..3f580a28f13 100644 --- a/releng/promote-a-build.Jenkinsfile +++ b/releng/promote-a-build.Jenkinsfile @@ -3,9 +3,10 @@ pipeline { agent any parameters { booleanParam(defaultValue: true, description: 'Do a dry run of the build. All commands will be echoed.First run with this on, then when you are sure it is right, choose rebuild in the passing job and uncheck this box', name: 'DRY_RUN') - string(defaultValue: '9.8', description: 'The major and minor version of CDT being released (e.g. 9.7, 9.8, 10.0).', name: 'MINOR_VERSION') - string(defaultValue: 'cdt-9.8.0', description: 'The full name of this release (e.g. cdt-9.4.2, cdt-9.5.0-rc1, cdt-9.5.0-photon-m7, cdt-9.5.0-photon-rc1)', name: 'MILESTONE') - string(defaultValue: 'cdt/job/main', description: 'The CI job name being promoted from (e.g. cdt/job/cdt_10_7, cdt/job/main', name: 'CDT_JOB_NAME') + string(defaultValue: '9.8', description: 'The major and minor version of CDT being released (e.g. 11.3, 12.0, cdt-lsp-1.0, cdt-lsp-1.1).', name: 'MINOR_VERSION') + string(defaultValue: 'cdt-9.8.0', description: 'The full name of this release (e.g. cdt-9.4.2, cdt-9.5.0-rc1, cdt-lsp-1.0.0, cdt-lsp-1.0.0-rc1)', name: 'MILESTONE') + choice(choices: ['cdt', 'cdt-lsp'], description: 'The repo being published', name: 'CDT_REPO') + string(defaultValue: 'main', description: 'The repo branch being published (e.g. main, master, cdt_11_3)', name: 'CDT_BRANCH') string(defaultValue: '12345', description: 'The CI build number being promoted from', name: 'CDT_BUILD_NUMBER') choice(choices: ['releases', 'builds'], description: 'Publish location (releases or builds)', name: 'RELEASE_OR_BUILD') } diff --git a/releng/scripts/promote-a-build.sh b/releng/scripts/promote-a-build.sh index acea1368548..70fb1b99bdf 100755 --- a/releng/scripts/promote-a-build.sh +++ b/releng/scripts/promote-a-build.sh @@ -8,8 +8,17 @@ SSHUSER="genie.cdt@projects-storage.eclipse.org" SSH="ssh ${SSHUSER}" SCP="scp" DOWNLOAD=/home/data/httpd/download.eclipse.org/tools/cdt/$RELEASE_OR_BUILD/$MINOR_VERSION/$MILESTONE -ARTIFACTS=https://ci.eclipse.org/cdt/job/$CDT_JOB_NAME/$CDT_BUILD_NUMBER/artifact -ARTIFACTS_REPO_TARGET=$ARTIFACTS/releng/org.eclipse.cdt.repo/target +ARTIFACTS=https://ci.eclipse.org/cdt/job/$CDT_REPO/job/$CDT_BRANCH/$CDT_BUILD_NUMBER/artifact +if [ "$CDT_REPO" == "cdt" ]; then + ARTIFACTS_REPO_TARGET=$ARTIFACTS/releng/org.eclipse.cdt.repo/target + ZIP_NAME=org.eclipse.cdt.repo.zip +elif [ "$CDT_REPO" == "cdt-lsp" ]; then + ARTIFACTS_REPO_TARGET=$ARTIFACTS/releng/org.eclipse.cdt.lsp.repository/target + ZIP_NAME=org.eclipse.cdt.lsp.repository.zip +else + echo "unexpected value for CDT_REPO: ${CDT_REPO}" + exit 1 +fi echo Using download location root of $DOWNLOAD echo Using artifacts location root of $ARTIFACTS @@ -35,6 +44,6 @@ $ECHO $SSH "cd $DOWNLOAD && \ rm -r repository repository.zip" $ECHO $SSH "cd $DOWNLOAD && \ - wget -q $ARTIFACTS_REPO_TARGET/org.eclipse.cdt.repo.zip && \ - mv org.eclipse.cdt.repo.zip $MILESTONE.zip" + wget -q $ARTIFACTS_REPO_TARGET/$ZIP_NAME && \ + mv $ZIP_NAME $MILESTONE.zip"