Skip to content

Commit 101ec03

Browse files
authored
[releng] Copy build output to final location in promotion script (#1462)
In the past we would download from CI, now we simply copy the latest build of the given branch to download location. This became necessary because there is no longer anonymous access to CI from download.eclipse.org, so the wget commands no longer work. The downside of this method is that we can only deploy the latest build on a branch. Worksaround https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/7520
1 parent 1ab8885 commit 101ec03

2 files changed

Lines changed: 9 additions & 32 deletions

File tree

releng/promote-a-build.Jenkinsfile

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ pipeline {
77
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')
88
choice(choices: ['cdt', 'cdt-lsp'], description: 'The repo being published', name: 'CDT_REPO')
99
string(defaultValue: 'main', description: 'The repo branch being published (e.g. main, master, cdt_11_3)', name: 'CDT_BRANCH')
10-
string(defaultValue: '12345', description: 'The CI build number being promoted from', name: 'CDT_BUILD_NUMBER')
1110
choice(choices: ['releases', 'builds'], description: 'Publish location (releases or builds)', name: 'RELEASE_OR_BUILD')
1211
}
1312
options {
@@ -24,17 +23,7 @@ pipeline {
2423
description = "Dry Run: $description"
2524
}
2625

27-
// TODO: Can we get permission from EF IT to use Jenkins.instance.getItemByFullName
28-
// def job = Jenkins.instance.getItemByFullName(jobName)
29-
// def build = job?.getBuildByNumber(buildNumber)
30-
31-
// if (build) {
32-
// build.setDescription(description)
33-
// build.keepLog(true)
34-
// } else {
35-
// echo "Build not found: ${jobName} #${CDT_BUILD_NUMBER}"
36-
// }
37-
currentBuild.description = "$description from <a href='https://ci.eclipse.org/cdt/job/$CDT_REPO/job/$CDT_BRANCH/$CDT_BUILD_NUMBER'>$CDT_REPO/job/$CDT_BRANCH/$CDT_BUILD_NUMBER</a>"
26+
currentBuild.description = "$description from <a href='https://ci.eclipse.org/cdt/job/$CDT_REPO/job/$CDT_BRANCH'>$CDT_REPO/job/$CDT_BRANCH</a>"
3827
}
3928
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
4029
sh './releng/scripts/promote-a-build.sh'

releng/scripts/promote-a-build.sh

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,20 @@ set -x # echo all commands used for debugging purposes
66

77
SSHUSER="genie.cdt@projects-storage.eclipse.org"
88
SSH="ssh ${SSHUSER}"
9-
SCP="scp"
109
DOWNLOAD=/home/data/httpd/download.eclipse.org/tools/cdt/$RELEASE_OR_BUILD/$MINOR_VERSION/$MILESTONE
11-
ARTIFACTS=https://ci.eclipse.org/cdt/job/$CDT_REPO/job/$CDT_BRANCH/$CDT_BUILD_NUMBER/artifact
10+
ARTIFACTS=/home/data/httpd/download.eclipse.org/tools/cdt/builds/$CDT_REPO/$CDT_BRANCH
11+
1212
if [ "$CDT_REPO" == "cdt" ]; then
13-
ARTIFACTS_REPO_TARGET=$ARTIFACTS/releng/org.eclipse.cdt.repo/target
1413
ZIP_NAME=org.eclipse.cdt.repo.zip
1514
elif [ "$CDT_REPO" == "cdt-lsp" ]; then
16-
ARTIFACTS_REPO_TARGET=$ARTIFACTS/releng/org.eclipse.cdt.lsp.repository/target
1715
ZIP_NAME=org.eclipse.cdt.lsp.repository.zip
1816
else
1917
echo "unexpected value for CDT_REPO: ${CDT_REPO}"
2018
exit 1
2119
fi
2220

23-
echo Using download location root of $DOWNLOAD
24-
echo Using artifacts location root of $ARTIFACTS
25-
26-
echo Testing to make sure artifacts location is sane
27-
wget -q --output-document=/dev/null $ARTIFACTS
21+
echo Using output download location root of $DOWNLOAD
22+
echo Using input download location root of $ARTIFACTS
2823

2924
ECHO=echo
3025
if [ "$DRY_RUN" == "false" ]; then
@@ -36,14 +31,7 @@ fi
3631
echo Testing to make sure we are publishing to a new directory
3732
$SSH "test ! -e $DOWNLOAD"
3833
$ECHO $SSH "mkdir -p $DOWNLOAD"
39-
40-
$ECHO $SSH "cd $DOWNLOAD && \
41-
wget -q $ARTIFACTS_REPO_TARGET/repository/*zip*/repository.zip && \
42-
unzip -q repository.zip && \
43-
mv repository/* . && \
44-
rm -r repository repository.zip"
45-
46-
$ECHO $SSH "cd $DOWNLOAD && \
47-
wget -q $ARTIFACTS_REPO_TARGET/$ZIP_NAME && \
48-
mv $ZIP_NAME $MILESTONE.zip"
49-
34+
echo Copying artifacts from latest build output of $CDT_REPO/$CDT_BRANCH to $DOWNLOAD
35+
$ECHO $SSH "cp -rpvf $ARTIFACTS/* $DOWNLOAD/"
36+
echo Renaming zip of artifacts to match the expected name for the milestone
37+
$ECHO $SSH "mv -vf $DOWNLOAD/$ZIP_NAME $DOWNLOAD/$MILESTONE.zip"

0 commit comments

Comments
 (0)