Skip to content

Instantly share code, notes, and snippets.

@waiyanwh
Created July 14, 2021 13:13
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 waiyanwh/05684b26e5a172f0321da707e954bba2 to your computer and use it in GitHub Desktop.
Save waiyanwh/05684b26e5a172f0321da707e954bba2 to your computer and use it in GitHub Desktop.
#!/bin/bash
user=
token=
newdev=25165825
newqa=25100295
dev=25034777
qa=25198603
if [[ $# -ne 1 ]]; then
echo "Usage: $1 <environment>"
exit 1
fi
case "$1" in
newdev)
environment=newdev
filename=newdev
id=25165825 ;;
newqa)
environment=newqa
filename=newqa
id=25100295 ;;
dev)
environment=dev
filename=dev
id=25034777 ;;
qa)
environment=qa
filename=qa
id=25198603 ;;
*) ;;
esac
#curl -s -u $user:$token "https://dopevs.atlassian.net/wiki/rest/api/content/$id" | jq
curl -s -u $user:$token -XPOST -H "X-Atlassian-Token: no-check" -F "file=@$filename" -F "comment=Update developer config for $environment" "https://dopevs.atlassian.net/wiki/rest/api/content/$id/child/attachment" | jq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment