Pass maven parameters to deploy maven-file 07/5607/8
authorAnil Belur <abelur@linuxfoundation.org>
Fri, 21 Jul 2017 11:21:53 +0000 (21:21 +1000)
committerAnil Belur <abelur@linuxfoundation.org>
Tue, 1 Aug 2017 21:39:23 +0000 (07:39 +1000)
Change-Id: I361a735779a3441551bc619cc57ff5db762cc5d5
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
lftools/cli/deploy.py
shell/deploy

index a2a1ed3..209e963 100644 (file)
@@ -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:
index 760d28c..06ee1bd 100755 (executable)
@@ -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 <maven_params>"
     echo "    -a <artifact_id>"
     echo "    -c <classifier>"
     echo "    -g <group_id>"
@@ -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"