Skip to content

Instantly share code, notes, and snippets.

@Nklya
Forked from arguile-/gist:2510227
Created October 3, 2017 14:46
Show Gist options
  • Save Nklya/85ed72ff35824cc21d4bced0dd0bb7c2 to your computer and use it in GitHub Desktop.
Save Nklya/85ed72ff35824cc21d4bced0dd0bb7c2 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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment