Skip to content

Instantly share code, notes, and snippets.

@dodok1
Last active November 20, 2020 01:15
Show Gist options
  • Save dodok1/4de391bcc0d385e0b5d97e5becbfb3de to your computer and use it in GitHub Desktop.
Save dodok1/4de391bcc0d385e0b5d97e5becbfb3de to your computer and use it in GitHub Desktop.
script to deploy add-on to UPM
echo source this script using . to define function below
echo script requires that packages 'curl' and 'jq' are installed
echo . upm_deploy_addon.sh
echo upm_deploy http://localhost:8080/jira admin:passwd path_to_addon.jar
upm_deploy() {
TOKEN=$(curl -s -I -u $2 $1/rest/plugins/1.0/|grep ^upm-token|cut -c12-|tr -d '[:space:]')
out=$(curl -s -X POST -u $2 -H "Accept: application/vnd.atl.plugins.installed+json" -F plugin=@$3 $1/rest/plugins/1.0/?token=$TOKEN)
while [ "$(echo $out | jq -r .status.done)" = "false" ]; do
sleep 1; echo -n .
pending=$(echo $out | jq -r .links.self)
out=$(curl -s -u $2 ${1%/*}$pending)
done
echo " $?"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment