From: Anil Belur Date: Fri, 21 Jul 2017 11:21:53 +0000 (+1000) Subject: Pass maven parameters to deploy maven-file X-Git-Tag: v0.7.0~10^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=c4084d7;p=releng%2Flftools.git Pass maven parameters to deploy maven-file Change-Id: I361a735779a3441551bc619cc57ff5db762cc5d5 Signed-off-by: Anil Belur --- diff --git a/lftools/cli/deploy.py b/lftools/cli/deploy.py index a2a1ed30..209e963b 100644 --- a/lftools/cli/deploy.py +++ b/lftools/cli/deploy.py @@ -78,6 +78,8 @@ def logs(ctx, nexus_url, nexus_path, build_url): help='Global settings file.') @click.option('-s', '--settings', envvar='SETTINGS_FILE', help='Settings file.') +@click.option('-p', '--maven-params', + help='Pass Maven commandline options to the mvn command.') # Maven Artifact GAV @click.option('-a', '--artifact-id', help='Maven Artifact ID.') @@ -94,6 +96,7 @@ def maven_file( # Maven Config ctx, nexus_url, repo_id, file_name, maven_bin, global_settings, settings, + maven_params, # Maven GAV artifact_id, group_id, classifier, version, pom_file): @@ -121,6 +124,8 @@ def maven_file( params.extend(["-l", global_settings]) if settings: params.extend(["-s", settings]) + if maven_params: + params.extend(["-p", maven_params]) # Maven Artifact GAV if artifact_id: diff --git a/shell/deploy b/shell/deploy index 760d28c5..06ee1bd5 100755 --- a/shell/deploy +++ b/shell/deploy @@ -262,6 +262,7 @@ deploy_maven_file_usage () { echo " -b /path/to/mvn" echo " -l /path/to/global-settings.xml" echo " -s /path/to/settings.xml" + echo " -p " echo " -a " echo " -c " echo " -g " @@ -285,8 +286,9 @@ deploy_maven_file () { # # If pom-file is passed in via the "-f" option then the Maven GAV parameters # are not necessary. pom-file setting overrides the Maven GAV parameters. - while getopts a:b:c:f:g:hl:m:s:v: o; do - case "$o" in + + while getopts a:b:c:f:g:hl:m:p:s:v: opts; do + case "$opts" in h) deploy_maven_file_usage exit 0 @@ -304,6 +306,10 @@ deploy_maven_file () { s) settings="$OPTARG" ;; + p) + local mvn_params="$OPTARG" + ;; + ######################### # Maven Artitfact (GAV) # @@ -383,6 +389,10 @@ deploy_maven_file () { params+=("-s $SETTINGS_FILE") fi + if [ ! -z "$mvn_params" ]; then + params+=("$mvn_params") + fi + local file_type if [[ "$file" == *.tar.gz ]]; then file_type="tar.gz"