Skip to content
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
46 changes: 41 additions & 5 deletions JenkinsJobs/Releng/promoteBuild.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ pipeline {
environment {
HIDE_SITE = 'true'
// Download Server locations (would very seldom change)
BUILD_ROOT = '/home/data/httpd/download.eclipse.org'
EP_ECLIPSE_ROOT = "${BUILD_ROOT}/eclipse"
EP_EQUINOX_ROOT = "${BUILD_ROOT}/equinox"
EP_ROOT = '/home/data/httpd/download.eclipse.org'
EP_ECLIPSE_ROOT = "${EP_ROOT}/eclipse"
EP_EQUINOX_ROOT = "${EP_ROOT}/equinox"
}
tools {
jdk 'temurin-jdk21-latest'
maven 'apache-maven-latest'
}
stages {
stage('Process input') {
Expand Down Expand Up @@ -60,6 +64,8 @@ pipeline {
assignEnvVariable('BUILD_SERVICE', versionMatcher.group('service'))
versionMatcher = null // release matcher as it's not serializable

assignEnvVariable('BUILD_REPO_ORIGINAL', "${BUILD_MAJOR}.${BUILD_MINOR}-${REPO_BUILD_TYPE}-builds")

if ("${CHECKPOINT}" ==~ /M\d+([a-z])?/ || "${CHECKPOINT}" ==~ /RC\d+([a-z])?/) { // milestone or RC promotion
assignEnvVariable('DL_TYPE', 'S')
// REPO_SITE_SEGMENT variale not used in this case
Expand Down Expand Up @@ -97,8 +103,6 @@ pipeline {
environment {
BUILDMACHINE_BASE_DL = "${EP_ECLIPSE_ROOT}/downloads/drops4"
BUILDMACHINE_BASE_EQ = "${EP_EQUINOX_ROOT}/drops"
BUILD_REPO_ORIGINAL = "${BUILD_MAJOR}.${BUILD_MINOR}-${REPO_BUILD_TYPE}-builds"
BUILDMACHINE_BASE_SITE = "${EP_ECLIPSE_ROOT}/updates/${BUILD_REPO_ORIGINAL}"
// Eclipse and Equinox drop Site (final segment)
ECLIPSE_DL_DROP_DIR_SEGMENT = "${DL_TYPE}-${DL_LABEL}-${BUILD_TIMESTAMP}"
EQUINOX_DL_DROP_DIR_SEGMENT = "${DL_TYPE}-${DL_LABEL_EQ}-${BUILD_TIMESTAMP}"
Expand Down Expand Up @@ -138,6 +142,38 @@ pipeline {
]
}
}
stage('Promote P2 Repository') {
when {
environment name: 'DL_TYPE', value: 'R'
}
steps {
dir("${WORKSPACE}/updates") {
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
sh '''#!/bin/bash -xe
git clone --depth=1 --filter=tree:0 --no-checkout --branch=master https://github.com/eclipse-platform/eclipse.platform.releng.aggregator.git
pushd eclipse.platform.releng.aggregator
git sparse-checkout set --no-cone eclipse-platform-parent/pom.xml
git checkout
popd

sourceRepo="eclipse/updates/${BUILD_REPO_ORIGINAL}/${REPO_ID}"
targetRepo="eclipse/updates/${REPO_SITE_SEGMENT}/${DL_DROP_ID}"
ssh [email protected] cp -r "${EP_ROOT}/${sourceRepo}/." "${EP_ROOT}/${targetRepo}"

MIRRORS_URL="https://www.eclipse.org/downloads/download.php?file=/${targetRepo}"
mvn tycho-p2-repository:modify-repository-properties -Pp2-repository-modification \\
--file eclipse.platform.releng.aggregator/eclipse-platform-parent/ \\
-Dp2.repository.location=https://download.eclipse.org/${sourceRepo}/ \\
-Dp2.repository.output=$(pwd)/output \\
-Dp2.repository.kind=artifact \\
-Dp2.repository.mirrorsURL=${MIRRORS_URL}

scp output/artifacts.* [email protected]:${EP_ROOT}/${targetRepo}
'''
}
}
}
}
}
post {
always {
Expand Down
68 changes: 0 additions & 68 deletions cje-production/promotion/promoteSites.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,65 +188,13 @@ function renameBuild ()
done
}

function createBaseBuilder ()
{
epRelDir=$(ssh [email protected] ls -d --format=single-column ${BUILDMACHINE_BASE_DL}/R-*|sort|tail -1)
BASEBUILDER_DIR=${WORKSPACE}/basebuilder
export BASEBUILDER_DIR
mkdir -p ${BASEBUILDER_DIR}
mkdir -p ${WORKSPACE}/tempEclipse
pushd ${WORKSPACE}/tempEclipse
scp [email protected]:${epRelDir}/eclipse-platform-*-linux-gtk-x86_64.tar.gz eclipse-platform.tar.gz
tar xvzf eclipse-platform.tar.gz
${WORKSPACE}/tempEclipse/eclipse/eclipse -nosplash \
-debug -consolelog -data ${WORKSPACE}/workspace-toolsinstall \
-application org.eclipse.equinox.p2.director \
-repository "https://download.eclipse.org/eclipse/updates/latest/","https://download.eclipse.org/eclipse/updates/buildtools/",${WEBTOOLS_REPO} \
-installIU org.eclipse.platform.ide,org.eclipse.pde.api.tools,org.eclipse.releng.build.tools.feature.feature.group,org.eclipse.wtp.releng.tools.feature.feature.group \
-destination ${BASEBUILDER_DIR} \
-profile SDKProfile
popd
export ECLIPSE_EXE=${BASEBUILDER_DIR}/eclipse
rm -rf ${WORKSPACE}/tempEclipse
}

function addRepoProperties ()
{
APP_NAME=org.eclipse.wtp.releng.tools.addRepoProperties
devworkspace=${devworkspace:-${WORKSPACE}/workspaceAddRepoProperties}

REPO=$1
REPO_TYPE=$2
BUILD_ID=$3

createBaseBuilder
MIRRORURL=/eclipse/updates/${REPO_TYPE}/${BUILD_ID}
MIRRORURL_ARG="https://www.eclipse.org/downloads/download.php?format=xml&file=${MIRRORURL}"

ART_REPO_NAME="Eclipse Project Repository for ${TRAIN_NAME}"
CON_REPO_NAME="Eclipse Project Repository for ${TRAIN_NAME}"

MIRRORS_URL_ARG=-Dp2MirrorsURL=${MIRRORURL_ARG}
ART_REPO_ARG=-DartifactRepoDirectory=${REPO}
CON_REPO_ARG=-DmetadataRepoDirectory=${REPO}
ART_REPO_NAME_ARG=-Dp2ArtifactRepositoryName=\"${ART_REPO_NAME}\"
CON_REPO_NAME_ARG=-Dp2MetadataRepositoryName=\"${CON_REPO_NAME}\"

${ECLIPSE_EXE} --launcher.suppressErrors -nosplash -consolelog -debug -data ${devworkspace} -application ${APP_NAME} -vmargs ${MIRRORS_URL_ARG} -Dp2ArtifactRepositoryName="${ART_REPO_NAME}" -Dp2MetadataRepositoryName="${CON_REPO_NAME}" ${ART_REPO_ARG} ${CON_REPO_ARG}
}

# Extract WEBTOOLS_REPO and other variables from buildproperties.shsource for the build
source ${WORKSPACE}/buildproperties.shsource

# Main promotion scripts starts here

#Take backup of current build
LOCAL_EP_DIR=${WORKSPACE}/eclipse
LOCAL_EQ_DIR=${WORKSPACE}/equinox
LOCAL_REPO=${WORKSPACE}/updates
mkdir -p ${LOCAL_EP_DIR}
mkdir -p ${LOCAL_EQ_DIR}
mkdir -p ${LOCAL_REPO}

pushd ${LOCAL_EP_DIR}
scp -r [email protected]:${BUILDMACHINE_BASE_DL}/${DROP_ID} .
Expand All @@ -256,10 +204,6 @@ pushd ${LOCAL_EQ_DIR}
scp -r [email protected]:${BUILDMACHINE_BASE_EQ}/${DROP_ID_EQ} .
popd

pushd ${LOCAL_REPO}
scp -r [email protected]:${BUILDMACHINE_BASE_SITE}/${REPO_ID} .
popd

# ### Begins the point of making modifications to the build ###
if [[ "${DL_TYPE}" != "R" ]]
then
Expand Down Expand Up @@ -323,15 +267,3 @@ pushd ${LOCAL_EP_DIR}
fi

popd


#Promote Repository
if [[ "${DL_TYPE}" == "R" ]]
then
pushd ${LOCAL_REPO}
BUILDMACHINE_SITE=${LOCAL_REPO}/${REPO_ID}
addRepoProperties ${BUILDMACHINE_SITE} ${REPO_SITE_SEGMENT} ${DL_DROP_ID}
mv ${REPO_ID} ${DL_DROP_ID}
scp -r ${LOCAL_REPO}/${DL_DROP_ID} [email protected]:${EP_ECLIPSE_ROOT}/updates/${REPO_SITE_SEGMENT}
popd
fi
21 changes: 21 additions & 0 deletions eclipse-platform-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1115,6 +1115,27 @@
</pluginManagement>
</build>
</profile>
<profile>
<id>p2-repository-modification</id>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-repository-plugin</artifactId>
<configuration><!-- Properties will be defined on the CLI. -->
<repository>
<url>${p2.repository.location}</url>
</repository>
<propertiesToAdd>
<p2.mirrorsURL>${p2.repository.mirrorsURL}</p2.mirrorsURL>
</propertiesToAdd>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>
<scm>
<connection>scm:git:https://github.com/eclipse-platform/eclipse.platform.releng.aggregator.git</connection>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<configuration>
<includeAllDependencies>true</includeAllDependencies>
<includeAllSources>true</includeAllSources>
<repositoryName>Eclipse ${releaseVersion}</repositoryName>
</configuration>
</plugin>
<plugin>
Expand Down
Loading