From: Anil Belur Date: Wed, 19 Jul 2017 10:14:49 +0000 (+1000) Subject: Pass common maven options to deploy file builder X-Git-Tag: v0.6.0~4^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F94%2F5594%2F6;p=releng%2Fglobal-jjb.git Pass common maven options to deploy file builder Uploading large files on nexus prints lots of unwanted messages in the logs, therefore disable this by passing predefiend options through $MAVEN_OPTIONS. Also pass any parameters to maven provided through job parameters. Change-Id: I2e11adcb26d07097fa43cc289175aaa1cda897f9 Signed-off-by: Anil Belur --- diff --git a/jjb/lf-macros.yaml b/jjb/lf-macros.yaml index b3e0222d..c9c1fd02 100644 --- a/jjb/lf-macros.yaml +++ b/jjb/lf-macros.yaml @@ -103,6 +103,7 @@ UPLOAD_FILES_PATH={files-dir} - shell: !include-raw-escape: - ../shell/lftools-install.sh + - ../shell/common-variables.sh - ../shell/deploy-maven-file.sh - lf-provide-maven-settings-cleanup diff --git a/shell/deploy-maven-file.sh b/shell/deploy-maven-file.sh index 0ae0f040..37cfd9f4 100644 --- a/shell/deploy-maven-file.sh +++ b/shell/deploy-maven-file.sh @@ -17,8 +17,14 @@ # $GROUP_ID : Provided by a job parameter. # $UPLOAD_FILES_PATH : Provided by a job parameter. echo "---> deploy-maven-file.sh" + +# DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound. # Ensure we fail the job if any steps fail. -set -eu -o pipefail +set -e -o pipefail +set +u + +export MAVEN_OPTIONS +export MAVEN_PARAMS DEPLOY_LOG="$WORKSPACE/archives/deploy-maven-file.log" mkdir -p "$WORKSPACE/archives" @@ -31,5 +37,7 @@ do "$REPO_ID" \ "$file" \ -b "$MVN" \ - -g "$GROUP_ID" | tee "$DEPLOY_LOG" + -g "$GROUP_ID" \ + -p "$MAVEN_PARAMS $MAVEN_OPTIONS" \ + |& tee "$DEPLOY_LOG" done < <(find "$UPLOAD_FILES_PATH" -type f -name "*")