Skip to content

Commit

Permalink
Added netrc param for curl
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Graf committed Jun 19, 2015
1 parent ab5402e commit 14bc02b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
12 changes: 10 additions & 2 deletions files/download-artifact-from-nexus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ OPTIONS:
-u Username
-p Password
-n Nexus Base URL
-m Use .netrc
-z if nexus has newer version of artifact, remove Output File and exit
EOF
Expand All @@ -39,10 +40,10 @@ REPO=
USERNAME=
PASSWORD=
VERBOSE=0

NETRC=
OUTPUT=

while getopts "hvza:c:e:o:r:u:p:n:" OPTION
while getopts "hvza:c:e:o:r:u:p:n:m" OPTION
do
case $OPTION in
h)
Expand All @@ -64,6 +65,9 @@ do
e)
PACKAGING=$OPTARG
;;
m)
NETRC=1
;;
v)
VERBOSE=1
;;
Expand Down Expand Up @@ -136,6 +140,10 @@ then
AUTHENTICATION="-u $USERNAME:$PASSWORD"
fi

if [[ "$NETRC" == "1" ]]
then
AUTHENTICATION="-n"
fi

if [[ "$SNAPSHOT_CHECK" != "" ]]
then
Expand Down
2 changes: 2 additions & 0 deletions manifests/artifact.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@

if($nexus::username and $nexus::password) {
$args = "-u ${nexus::username} -p '${nexus::password}'"
} elsif ($nexus::netrc) {
$args = "-m"
}

if ($classifier) {
Expand Down
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# [*url*] : The Nexus base url (mandatory)
# [*username*] : The username used to connect to nexus
# [*password*] : The password used to connect to nexus
# [*netrc*] : Use .netrc to connect to nexus
#
# Actions:
# Checks and intialized the Nexus support.
Expand All @@ -21,6 +22,7 @@
$url,
$username = undef,
$password = undef,
$netrc = undef,
) {

# Check arguments
Expand Down

0 comments on commit 14bc02b

Please sign in to comment.