Hi,
I just wanted to share where I am at with creating a job to
promote artifacts from staging
that I am working on for the JTA project (
https://jenkins.eclipse.org/jta/job/eclipse-ee4j_jta-api-EE4J_8-promote/). It uses some of the nexus goals that Romain identified earlier.
Create a new freestyle project: eclipse-ee4j_jta-api-EE4J_8-promote
Settings are as follows:
* General
** GitHub project
https://github.com/eclipse-ee4j/jta-api/** This build is parameterized: TAG
** I turned off "Restrict where this project can be run"
* Source Code Management:
** Git
*** Repositories
**** git@xxxxxxxxxx:eclipse-ee4j/jta-api.git
**** Credentials jta-bot
**** Branch specifier: tags/$TAG
* Build Environment
** Provide configuration files
*** Add file settings-security.xml /home/jenkins/.m2/
*** Add file settings-jta.xml /home/jenkins/.m2/
** SSH Agent
*** jta-bot
* Build
** Add build step
*** Execute shell
#!/bin/bash -ex
TOOLS_PREFIX='/opt/tools'
JAVA_PREFIX="${TOOLS_PREFIX}/java/oracle"
MVN_HOME="${TOOLS_PREFIX}/apache-maven/latest"
JAVA_HOME="${JAVA_PREFIX}/jdk-8/latest"
PATH="${MVN_HOME}/bin:${JAVA_HOME}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
NEXUS_PLUGIN='org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8'
STAGING_REPO_ID=$(mvn -U -C -s /home/jenkins/.m2/settings-jta.xml \
-DskipTests -Ddoclint=none -Poss-release \
$NEXUS_PLUGIN:rc-list -DnexusUrl=
https://oss.sonatype.org/ -DserverId=<from-settings-jta.xml> | \
egrep "^\[INFO\] jakartatransaction\-[0-9]+[ ]+OPEN[ ]+Implicitly created.*" | \
awk '{print $2}' | head -1)
echo Will be closing $STAGING_REPO_ID
# Close and release the nexus staging repository
#mvn -U -C -s /home/jenkins/.m2/settings-jta.xml \
# -DskipTests -Ddoclint=none -Poss-release \
# $NEXUS_PLUGIN:rc-close -DnexusUrl=
https://oss.sonatype.org/ -DserverId=
<from-settings-jta.xml>
\
# -DstagingRepositoryId=${STAGING_REPO_ID}