Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate rename provisional to final #247

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,21 +103,10 @@ This applies to all releases, i.e. M1, M2, M3, RC1 and R. Everything except R is

- [ ] **24 Hours before Final release** Make sure files are in final location to allow downloads to mirror
- [ ] Tag the release, e.g. with 2020-03_R. Example command line: `git tag --annotate 2020-03_R -m"2020-03 Release" 1b7a1c1af156e3ac57768b87be258cd22b49456b`
- [ ] rename the provisional release milestone to final directory (E.g. [2020-09/202009101200](https://download.eclipse.org/technology/epp/downloads/release/2020-09/202009101200/) -> [2020-09/R](https://download.eclipse.org/technology/epp/downloads/release/2020-09/R/) (to match what is in [release.xml](https://download.eclipse.org/technology/epp/downloads/release/release.xml)) - this only applies to downloads, not to packages
- [ ] Run the [Rename Provisional to Final](https://ci.eclipse.org/packaging/job/rename-provisional-to-final/) CI job to rename the provisional release milestone to final directory. (E.g. [2020-09/202009101200](https://download.eclipse.org/technology/epp/downloads/release/2020-09/202009101200/) -> [2020-09/R](https://download.eclipse.org/technology/epp/downloads/release/2020-09/R/) (to match what is in [release.xml](https://download.eclipse.org/technology/epp/downloads/release/release.xml)) - this only applies to downloads, not to packages
- [ ] _Optional - useful when testing changes to the promotion scripts:_ Run the build once in `DRY_RUN` mode to ensure that the output is correct before it applies changes to download.eclipse.org.
- [ ] Send an updated email to epp-dev informing that the provisional URL has been renamed to `R`.

Renaming the directory can be done with a script like **TODO: make a job for this** :

```sh
ssh [email protected] /bin/bash << EOF
set -u # run with unset flag error so that missing parameters cause build failure
set -e # error out on any failed commands
set -x # echo all commands used for debugging purposes
mv -v /home/data/httpd/download.eclipse.org/technology/epp/downloads/release/2021-03/202103121200 /home/data/httpd/download.eclipse.org/technology/epp/downloads/release/2021-03/R
touch /home/data/httpd/download.eclipse.org/technology/epp/downloads/release/2021-03/R/*
EOF
```

**On Final release day**

These jobs should be completed by approximately 10am Ottawa time on release days.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Based on https://wiki.eclipse.org/Jenkins#Pipeline_job_without_custom_pod_template
pipeline {
agent any
parameters {
booleanParam(defaultValue: true, description: 'Do a dry run of the operation', name: 'DRY_RUN')
}
options {
timestamps()
disableConcurrentBuilds()
}
tools {
maven 'apache-maven-latest'
jdk 'temurin-jdk17-latest'
}
stages {
stage('Rename') {
steps {
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
sh './releng/org.eclipse.epp.config/tools/rename-provisional-to-final.sh'
}
}
}
}
post {
cleanup {
cleanWs()
}
}
}
60 changes: 60 additions & 0 deletions releng/org.eclipse.epp.config/tools/rename-provisional-to-final.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/bash

set -u # run with unset flag error so that missing parameters cause build failure
set -e # error out on any failed commands
set -x # echo all commands used for debugging purposes

DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
# Read a property from the epp.properties file (which needs to be generated)
# Usage: get_property KEY
function get_property
{
grep "^$1=" "${DIR}/epp.properties" | cut -d'=' -f2 | sed '-es,\\:,:,'
}

echo Create the epp.properties file
MVN=/opt/tools/apache-maven/latest/bin/mvn
if [ ! -f "$MVN" ]; then
MVN=mvn
fi
${MVN} clean package -f ${DIR}

RELEASE_NAME=$(get_property RELEASE_NAME)
RELEASE_MILESTONE=$(get_property RELEASE_MILESTONE)
RELEASE_DIR=$(get_property RELEASE_DIR)
SIMREL_REPO=$(get_property SIMREL_REPO)
EPP_DOWNLOADS=/home/data/httpd/download.eclipse.org/technology/epp
DOWNLOADS=${EPP_DOWNLOADS}/downloads/release/${RELEASE_NAME}
REPO=${EPP_DOWNLOADS}/packages/${RELEASE_NAME}/

SSHUSER="[email protected]"
SSH="ssh ${SSHUSER}"
SCP="scp"


ECHO=echo
if [ "$DRY_RUN" == "false" ]; then
ECHO=""
else
echo Dry run of build:
fi

if [ "$RELEASE_MILESTONE" != "R" ]; then
$ECHO "This job is only inteded for R builds"
else
$ECHO $SSH mv ${DOWNLOADS}/${RELEASE_DIR} ${DOWNLOADS}/R
TOUCHDIRS="${DOWNLOADS}/R"
fi

# ----------------------------------------------------------------------------------------------
# Touch All Files See Bug 568574: Touch all files for the milestone in the download area to make sure mirrors are not misreporting them as mirrored before sending announcements.
echo Touching ${TOUCHDIRS} recursively
$ECHO $SSH /bin/bash << EOF
set -u # run with unset flag error so that missing parameters cause build failure
set -e # error out on any failed commands
set -x # echo all commands used for debugging purposes
find ${TOUCHDIRS} | while read i
do
touch \$i
done
EOF
Loading