Last active
April 22, 2025 12:19
-
-
Save rpau/a604b097bdf33fa69799df0a5a393e1e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| export $BB_HOST="bitbucket.org" | |
| export $PROJECT="REPLACE_ACME_PROJECT" | |
| export $SLUG="REPLACE_ACME_REPO" | |
| export $ACCESS_TOKEN="REPLACE_ACCESS_TOKEN" | |
| advisor build-config get | |
| advisor upgrade-plan apply | |
| if [ $(git status --porcelain | wc -l) -eq "0" ]; then | |
| echo " Git repo is clean." | |
| else | |
| if [ `git branch --list advisor` ] | |
| then | |
| echo "Pending changes to upgrade" | |
| else | |
| git checkout -b advisor | |
| git add . | |
| git commit -m "[Spring Application Advisor] Spring upgrade" | |
| git push --set-upstream origin advisor | |
| curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $ACCESS_TOKEN" -H 'Content-Type: application/json' https://api.bitbucket.org/2.0/repositories/$PROJECT/$SLUG/pullrequests -d '{"title": "advisor upgrade" , "source": { "branch": { "name": "advisor" }}}' | |
| fi | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment