Skip to content

Commit

Permalink
Replace epp-createNextRelease and epp-promoteReleaseToLatest
Browse files Browse the repository at this point in the history
There is a new job finalize-release that does the job of the above
two jobs, but does it without parameters that need updating, instead
drawing the required information from the maven poms like the
other scripts do.
  • Loading branch information
jonahgraham committed Dec 3, 2024
1 parent 5e4430f commit 1de98a6
Show file tree
Hide file tree
Showing 3 changed files with 175 additions and 2 deletions.
6 changes: 4 additions & 2 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,7 @@ This applies to all releases, i.e. M1, M2, M3, RC1 and R. Everything except R is

These jobs should be completed by approximately 10am Ottawa time on release days.

- [ ] The current release needs to be promoted as "latest" under https://download.eclipse.org/technology/epp/packages/latest/ . This should be a composite pointing to specific https://download.eclipse.org/technology/epp/packages/yyyy-MM/ . This is achieved by triggering the [epp-promoteReleaseToLatest](https://ci.eclipse.org/packaging/job/epp-promoteReleaseToLatest).
- [ ] The _next_ release sub-directory needs to be created immediately, i.e. when 2019-12 was released, a directory 2020-03 had been created with an empty p2 composite repository pointing to 2019-12 until M1. (Use Job https://ci.eclipse.org/packaging/job/epp-createNextRelease/) On M1 release day this changes to a composite p2 repository with M1 content. On other release days, add the new releases as children and on final release this changes to a composite with just the one child.
- [ ] Run the [Finalize Release](https://ci.eclipse.org/packaging/job/finalize-release/) CI job to create the "next" release and updated the "latest" release as follows:
- The current release needs to be promoted as "latest" under https://download.eclipse.org/technology/epp/packages/latest/ . This should be a composite pointing to specific https://download.eclipse.org/technology/epp/packages/yyyy-MM/ .
- The _next_ release sub-directory needs to be created immediately, i.e. when 2019-12 was released, a directory 2020-03 had been created with an empty p2 composite repository pointing to 2019-12 until M1. On M1 release day this changes to a composite p2 repository with M1 content.
- [ ] _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.
29 changes: 29 additions & 0 deletions releng/org.eclipse.epp.config/tools/finalize-release.Jenkinsfile
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('Finalize Release') {
steps {
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
sh './releng/org.eclipse.epp.config/tools/finalize-release.sh'
}
}
}
}
post {
cleanup {
cleanWs()
}
}
}
142 changes: 142 additions & 0 deletions releng/org.eclipse.epp.config/tools/finalize-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
#!/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)
PREV_RELEASE_NAME=$(get_property PREV_RELEASE_NAME)
NEXT_RELEASE_NAME=$(get_property NEXT_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"
exit 1
fi


echo "----------------------------------------------------------------------------------------------"
echo "Prepare compositeArtifacts.xml/compositeContent.xml for "latest" that points at RELEASE_NAME"
$ECHO ${SSH} mkdir ${EPP_DOWNLOADS}/packages/latest/

TIMESTAMP=$(date +%s000)

CONTENTXML="<?xml version='1.0' encoding='UTF-8'?>
<?compositeMetadataRepository version='1.0.0'?>
<repository name='Eclipse Packaging Project EPP Latest (${RELEASE_NAME})'
type='org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository'
version='1.0.0'>
<properties size='1'>
<property name='p2.timestamp' value='${TIMESTAMP}'/>
</properties>
<children size='1'>
<child location='../${RELEASE_NAME}'/>
</children>
</repository>
"

echo "$CONTENTXML" > ./compositeContent.xml
echo "==== Start Content of compositeContent.xml ===="
cat ./compositeContent.xml
echo "==== End Content of compositeContent.xml ===="
$ECHO $SCP compositeContent.xml "${SSHUSER}:"${EPP_DOWNLOADS}/packages/latest/

ARTIFACTXML="<?xml version='1.0' encoding='UTF-8'?>
<?compositeArtifactRepository version='1.0.0'?>
<repository name='Eclipse Packaging Project EPP Latest (${RELEASE_NAME})'
type='org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository'
version='1.0.0'>
<properties size='1'>
<property name='p2.timestamp' value='${TIMESTAMP}'/>
</properties>
<children size='1'>
<child location='../${RELEASE_NAME}'/>
</children>
</repository>
"

echo "$ARTIFACTXML" > ./compositeArtifacts.xml
echo "==== Start Content of compositeArtifacts.xml ===="
cat ./compositeArtifacts.xml
echo "==== End Content of compositeArtifacts.xml ===="
$ECHO $SCP compositeArtifacts.xml "${SSHUSER}:"${EPP_DOWNLOADS}/packages/latest/


echo "----------------------------------------------------------------------------------------------"
echo "Prepare compositeArtifacts.xml/compositeContent.xml for next release that points at RELEASE_NAME"
$ECHO ${SSH} mkdir ${EPP_DOWNLOADS}/packages/${NEXT_RELEASE_NAME}/

TIMESTAMP=$(date +%s000)

CONTENTXML="<?xml version='1.0' encoding='UTF-8'?>
<?compositeMetadataRepository version='1.0.0'?>
<repository name='Eclipse Packaging Project EPP ${NEXT_RELEASE_NAME}'
type='org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository'
version='1.0.0'>
<properties size='1'>
<property name='p2.timestamp' value='${TIMESTAMP}'/>
</properties>
<children size='1'>
<child location='../${RELEASE_NAME}'/>
</children>
</repository>
"

echo "$CONTENTXML" > ./compositeContent.xml
echo "==== Start Content of compositeArtifacts.xml ===="
cat ./compositeArtifacts.xml
echo "==== End Content of compositeArtifacts.xml ===="
$ECHO $SCP compositeContent.xml "${SSHUSER}:"${EPP_DOWNLOADS}/packages/${NEXT_RELEASE_NAME}/

ARTIFACTXML="<?xml version='1.0' encoding='UTF-8'?>
<?compositeArtifactRepository version='1.0.0'?>
<repository name='Eclipse Packaging Project EPP ${NEXT_RELEASE_NAME}'
type='org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository'
version='1.0.0'>
<properties size='1'>
<property name='p2.timestamp' value='${TIMESTAMP}'/>
</properties>
<children size='1'>
<child location='../${RELEASE_NAME}'/>
</children>
</repository>
"

echo "$ARTIFACTXML" > ./compositeArtifacts.xml
echo "==== Start Content of compositeArtifacts.xml ===="
cat ./compositeArtifacts.xml
echo "==== End Content of compositeArtifacts.xml ===="
$ECHO $SCP compositeArtifacts.xml "${SSHUSER}:"${EPP_DOWNLOADS}/packages/${NEXT_RELEASE_NAME}/

0 comments on commit 1de98a6

Please sign in to comment.