Skip to content

Instantly share code, notes, and snippets.

@arguile-
Created April 27, 2012 15:36
Show Gist options
  • Save arguile-/2510227 to your computer and use it in GitHub Desktop.
Save arguile-/2510227 to your computer and use it in GitHub Desktop.
Basic Curl deploy file to Nexus
#!/bin/sh
SERVER="http://localhost:8081"
URL="$SERVER/nexus/service/local/artifact/maven/content"
REPO="sandbox"
USER="admin:admin123"
group=$1
artifact=$2
version=$3
classifier=$4
ext=$5
filename=$6
curl --write-out "\nStatus: %{http_code}\n" \
--request POST \
--user $USER \
-F "r=$REPO" \
-F "g=$group" \
-F "a=$artifact" \
-F "v=$version" \
-F "c=$classifier" \
-F "p=$ext" \
-F "file=@$filename" \
"$URL"
@kalyanbhave
Copy link

kalyanbhave commented May 24, 2016

Can I get similar script in PowerShell

@nitin-das
Copy link

nitin-das commented Aug 1, 2016

Download the curl for windows
curl --request POST --user deployment -F r= -F g= -F a= -F v= -F file= -u : /

@davidmichaelkarr
Copy link

I haven't verified this, but I'm guessing that "--request POST" is redundant. It's somewhat logical, as "-F" forms POST data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment