Let NEXUSPROXY override NEXUS_URL if both are set
[releng/global-jjb.git] / shell / create-netrc.sh
index 4a15e3b..35bc0c3 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/bash
-# @License EPL-1.0 <http://spdx.org/licenses/EPL-1.0>
+# SPDX-License-Identifier: EPL-1.0
 ##############################################################################
 # Copyright (c) 2017 The Linux Foundation and others.
 #
@@ -8,8 +8,12 @@
 # which accompanies this distribution, and is available at
 # http://www.eclipse.org/legal/epl-v10.html
 ##############################################################################
+echo "---> create-netrc.sh"
 
-NEXUS_URL="${NEXUS_URL:-$NEXUSPROXY}"
+# Ensure we fail the job if any steps fail.
+set -eu -o pipefail
+
+NEXUS_URL="${NEXUSPROXY:-$NEXUS_URL}"
 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 \