Add ALT_NEXUS_URL to create-netrc 06/10606/2
authorJeremy Phelps <jphelps@linuxfoundation.org>
Fri, 11 May 2018 18:33:03 +0000 (13:33 -0500)
committerJeremy Phelps <jphelps@linuxfoundation.org>
Fri, 11 May 2018 19:39:25 +0000 (14:39 -0500)
This change is backwards compatible with existing system configs but
lets the user spec this env var which will take precedence.  This is
useful, for example, to point at nexus3.edgexfoundry.org if you have
NEXUS_URL=nexus.edgexfoundry.org.

Change-Id: Ibbba26670ab374fd98e1bf20f78ffff7f8b7c52a
Signed-off-by: Jeremy Phelps <jphelps@linuxfoundation.org>
docs/jjb/lf-macros.rst
shell/create-netrc.sh

index 72d898c..724dad6 100644 (file)
@@ -25,6 +25,13 @@ Create a ~/.netrc file from a Maven settings.xml
 
     :server-id: The id of a server as defined in settings.xml.
 
+:Optional parameters:
+
+    :ALT_NEXUS_SERVER: URL of custom nexus server.
+        If set this will take precedence.
+        Use this to point at nexus3.$PROJECTDOMAIN
+        for example.
+
 lf-infra-deploy-maven-file
 --------------------------
 
index 2c7f782..b309c54 100644 (file)
@@ -13,7 +13,15 @@ echo "---> create-netrc.sh"
 # Ensure we fail the job if any steps fail.
 set -eu -o pipefail
 
-NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}"
+ALT_NEXUS_URL="${ALT_NEXUS_URL}"
+
+if [ -z "$ALT_NEXUS_URL" ]
+then
+    NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}"
+else
+    NEXUS_URL="${ALT_NEXUS_URL}"
+fi
+
 CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
     -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
     -v x:username -o ":" -v x:password \