X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fcreate-netrc.sh;h=3f0c70e43a2be3382c59c4df75cebf113ad24a95;hb=4fe23ea9d77e245a36a6d57fc4b271dfe1cf3dd7;hp=4a15e3b661c114a9a5f600538033a9cf8b118657;hpb=851b0b6d0cfe84e986548fd596a9b2f18413fefd;p=releng%2Fglobal-jjb.git diff --git a/shell/create-netrc.sh b/shell/create-netrc.sh index 4a15e3b6..3f0c70e4 100644 --- a/shell/create-netrc.sh +++ b/shell/create-netrc.sh @@ -1,5 +1,5 @@ #!/bin/bash -# @License EPL-1.0 +# SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2017 The Linux Foundation and others. # @@ -8,6 +8,10 @@ # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html ############################################################################## +echo "---> create-netrc.sh" + +# Ensure we fail the job if any steps fail. +set -eu -o pipefail NEXUS_URL="${NEXUS_URL:-$NEXUSPROXY}" CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ @@ -19,4 +23,4 @@ machine=$(echo "$NEXUS_URL" | awk -F/ '{print $3}') user=$(echo "$CREDENTIAL" | cut -f1 -d:) pass=$(echo "$CREDENTIAL" | cut -f2 -d:) -echo "machine $machine login $user password $pass" > ~/.netrc +echo "machine ${machine%:*} login $user password $pass" > ~/.netrc