Skip to content

Instantly share code, notes, and snippets.

@yarinkos
Last active September 28, 2016 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yarinkos/43995985136969fa9c664ab4a7ff8b3b to your computer and use it in GitHub Desktop.
Save yarinkos/43995985136969fa9c664ab4a7ff8b3b to your computer and use it in GitHub Desktop.
upload archive to nexus
#!/bin/sh
SERVER=$1
GROUPID=$2
ARTIFACTID=$3
VERSION=$4
USER=$5
FILENAME=$6
REPO=$7
URL="$SERVER/nexus/service/local/artifact/maven/content"
# if snapshots,pay attention that manual upload is supported
group=GROUPID
artifact=ARTIFACTID
version=VERSION
classifier=demo
ext=tar.gz
filename=$FILENAME
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