From: Jeremy Phelps Date: Fri, 11 May 2018 18:33:03 +0000 (-0500) Subject: Add ALT_NEXUS_URL to create-netrc X-Git-Tag: v0.20.0~10 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F06%2F10606%2F2;p=releng%2Fglobal-jjb.git Add ALT_NEXUS_URL to create-netrc 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 --- diff --git a/docs/jjb/lf-macros.rst b/docs/jjb/lf-macros.rst index 72d898c6..724dad65 100644 --- a/docs/jjb/lf-macros.rst +++ b/docs/jjb/lf-macros.rst @@ -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 -------------------------- diff --git a/shell/create-netrc.sh b/shell/create-netrc.sh index 2c7f7823..b309c54b 100644 --- a/shell/create-netrc.sh +++ b/shell/create-netrc.sh @@ -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 \