Skip to content
Merged
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: 8 additions & 38 deletions JenkinsJobs/Releng/publishToMaven.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,42 +14,30 @@ pipeline {
maven 'apache-maven-latest'
}
environment {
// Filter out all the feature, test, and product IUs that are not published. Escape dots to match them literally
REPO = "${WORKSPACE}/repo"
PATH = "${installMavenDaemon('1.0.2')}/bin:${PATH}"
CBI_AGGR = "${installLatestCbiAggr()}"
// Folder ~/.m2 is not writable for builds, ensure mvnd metadata are written within the workspace.
// prevent jline warning about inability to create a system terminal and increase keep-alive timeouts to increase stability in concurrent usage
MVND = "mvnd -Dmvnd.daemonStorage=${WORKSPACE}/tools/mvnd -Dorg.jline.terminal.type=dumb -Dmvnd.keepAlive=1000 -Dmvnd.maxLostKeepAlive=600"
ECLIPSE = "${installLatestEclipse()}"
URL_AGG_UPDATES = 'https://download.eclipse.org/cbi/updates/p2-aggregator/products/nightly/latest'
}
// parameters declared in the definition of the invoking job
stages {
stage('Aggregate Maven repository') {
steps {
sh '''#!/bin/bash -e
echo "==== Install and run the CBI aggregator ===="

DIR_AGGREGATOR="${WORKSPACE}/tools/aggregator"
FILE_SDK_AGGR="${WORKSPACE}/git-repo/eclipse.platform.releng/publish-to-maven-central/SDK4Mvn.aggr"

# Set whether this is a snapshot build or not
if [ "${snapshotOrRelease}" = "-snapshot" ]; then
sed -e 's/snapshot=".*"/snapshot="true"/g' -i ${FILE_SDK_AGGR}
fi

echo "Installing the CBI aggregator into ${DIR_AGGREGATOR} ..."
${ECLIPSE} --launcher.suppressErrors -noSplash \\
-application org.eclipse.equinox.p2.director \\
-r ${URL_AGG_UPDATES} \\
-d ${DIR_AGGREGATOR} -p CBIProfile \\
-installIU org.eclipse.cbi.p2repo.cli.product

repoRaw="${WORKSPACE}/repo-raw"
mkdir ${repoRaw}

echo "Running the aggregator with build model ${FILE_SDK_AGGR} ..."
"${DIR_AGGREGATOR}/cbiAggr" aggregate --buildModel ${FILE_SDK_AGGR} \\
"${CBI_AGGR}" aggregate --buildModel ${FILE_SDK_AGGR} \\
--action CLEAN_BUILD --buildRoot ${repoRaw} \\
-vmargs -Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclientjava

Expand Down Expand Up @@ -78,8 +66,7 @@ pipeline {
}
}
stage('Validate repository') {
// It prunes down the set of artifacts to be published, e.g., eliminate test artifacts,
// and it tests that each to-be-published artifact can transitively resolve all its dependencies.
// Tests that each to-be-published artifact can transitively resolve all its dependencies.
steps {
dir('repo-validation') { // Do the work in a clean folder without a pom.xml
sh '''#!/bin/bash -xe
Expand Down Expand Up @@ -148,26 +135,15 @@ pipeline {
SOURCES_ARG="-Dsources=${sourcesFile}"
else
SOURCES_ARG=""
# If the -sources.jar is missing, and the main jar contains .class files, then we won't be able to promote this to Maven central.
if unzip -l ${file} | grep -q -e '.class$'; then
echo "BUILD FAILURE ${file} contains .class files and requires a ${sourcesFile}"
exit 1
else
echo "Missing ${sourcesFile} but ${file} contains no .class files."
fi;
echo "No ${sourcesFile}."
fi

if [ -f "${javadocFile}" ]; then
echo "${javadocFile}"
JAVADOC_ARG="-Djavadoc=${javadocFile}"
else
JAVADOC_ARG=""
if unzip -l ${file} | grep -q -e '.class$'; then
echo "BUILD FAILURE ${file} contains .class files and requires a ${javadocFile}"
exit 1
else
echo "Missing ${javadocFile} but ${file} contains no .class files."
fi;
echo "No ${javadocFile}."
fi
set -x

Expand Down Expand Up @@ -204,15 +180,9 @@ def installMavenDaemon(String version) {
return install('mvnd', "https://downloads.apache.org/maven/mvnd/${version}/maven-mvnd-${version}-linux-amd64.tar.gz")
}

def installLatestEclipse(){
def props = null
dir("${WORKSPACE}/git-repo") {
props = readProperties(file: 'cje-production/buildproperties.txt').collectEntries{n, v ->
v = v.trim();
return [n, (v.startsWith('"') && v.endsWith('"') ? v.substring(1, v.length() - 1) : v)]
}
}
return install('eclipse', "https://download.eclipse.org/eclipse/downloads/drops4/${props.PREVIOUS_RELEASE_ID}/eclipse-SDK-${props.PREVIOUS_RELEASE_VER}-linux-gtk-x86_64.tar.gz") + '/eclipse'

def installLatestCbiAggr(){
return install('cbiAggr', "https://download.eclipse.org/cbi/updates/p2-aggregator/products/nightly/latest/org.eclipse.cbi.p2repo.cli.product-linux.gtk.x86_64.tar.gz") + '/cbiAggr'
}

def install(String toolType, String url) {
Expand Down
Loading