Skip to content

Instantly share code, notes, and snippets.

@arun-gupta
Last active January 3, 2016 05:39
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 arun-gupta/8417713 to your computer and use it in GitHub Desktop.
Save arun-gupta/8417713 to your computer and use it in GitHub Desktop.
Deploy using curl
hash=`curl -X POST -F "file=@javaee7-1.0-SNAPSHOT.war;Content-Type=application/octet-stream" --digest http://u1:p1@localhost:9990/management/add-content | sed -e "s/.*\"BYTES_VALUE\".*\:.*\"\(.*\)\".*/\1/g"`
echo "The uploaded hash is: $hash."
content='{"content":[{"hash" : {"BYTES_VALUE":"'$hash'"}}],
"address"[{"deployment":"foo.jar"}],
"operation":"add",
"enabled":"true"}'
result=`curl -S -X POST -d $content --digest http://localhost:9990/management`
echo "Success!!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment