Last active
April 6, 2018 13:35
-
-
Save dodok1/b56df9b2f4526bd18819dce1035c04aa to your computer and use it in GitHub Desktop.
List installed addongs
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
#!/bin/bash | |
#### | |
# extractUserAddons.sh <baseurl> <userid> <passwd> | |
# | |
BASEURL=$1 | |
USERID=$2 | |
PASSWD=$3 | |
if [ -z "$BASEURL" -o -z "$USERID" ]; then | |
echo "provide baseurl userid [password]" | |
exit 1 | |
fi | |
if [ -z "$PASSWD" ]; then | |
read -s -p "Password:" PASSWD | |
echo | |
fi | |
# | |
# use curl to retrieve all the addons from the UPM on the JIRA | |
# use jq to select only the addons which have properties .userInstalled and | |
# | |
echo '|| Key || Version || Name || License || Vendor ||' | |
curl -s --user $USERID:$PASSWD $BASEURL/rest/plugins/1.0/ | jq -r '.plugins | map(select(.userInstalled and (.applicationPluginType // "PRIMARY") == "PRIMARY")) | .[] | "| \(.key) | \(.version) | \(.name) | \(.usesLicensing) | \(.vendor.name) |"' | sort |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment