Split out maven-deploy into a reusable macro.
Change-Id: I6ddad68576cdbf9d9ef8b4805da94dc6a80cbefd
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Common Jenkins configuration for Maven jobs.
+lf-maven-deploy
+---------------
+
+Calls the maven deploy script to push artifacts to Nexus.
Job Templates
=============
- github-maven-javadoc-publish
- github-maven-javadoc-verify
+##########
+# Macros #
+##########
+
+- builder:
+ name: lf-maven-deploy
+ builders:
+ - shell: !include-raw:
+ - ../shell/common-variables.sh
+ - ../shell/maven-deploy.sh
+
####################
# COMMON FUNCTIONS #
####################
- ../shell/common-variables.sh
- ../shell/maven-fetch-metadata.sh
- ../shell/maven-build.sh
- - ../shell/maven-deploy.sh
+ - lf-maven-deploy
- lf-provide-maven-settings-cleanup
publishers:
-Dmaven.repo.local=/tmp/r \
-Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r)"
echo "$MAVEN_OPTIONS"
+
+# Activates the lftools virtualenv
+lftools_activate() {
+ virtualenv --quiet "/tmp/v/lftools"
+ # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
+ source "/tmp/v/lftools/bin/activate"
+}
m2repo_dir="$WORKSPACE/m2repo"
nexus_repo_url="$NEXUS_URL/content/repositories/$NEXUS_REPO"
+lftools_activate
+
# Remove metadata files that were not updated.
set +e # Temporarily disable to run diff command.
IFS=" " read -r -a metadata_files <<< "$(diff -s -r "$m2repo_dir" "$WORKSPACE/m2repo-backup" \