Last active
November 20, 2020 01:15
-
-
Save dodok1/4de391bcc0d385e0b5d97e5becbfb3de to your computer and use it in GitHub Desktop.
script to deploy add-on to UPM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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