Pass common maven options to deploy file builder 94/5594/6
authorAnil Belur <abelur@linuxfoundation.org>
Wed, 19 Jul 2017 10:14:49 +0000 (20:14 +1000)
committerAnil Belur <abelur@linuxfoundation.org>
Mon, 24 Jul 2017 12:28:47 +0000 (22:28 +1000)
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 <abelur@linuxfoundation.org>
jjb/lf-macros.yaml
shell/deploy-maven-file.sh

index b3e0222..c9c1fd0 100644 (file)
               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
 
index 0ae0f04..37cfd9f 100644 (file)
 # $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 "*")