Created
June 10, 2020 09:39
-
-
Save minho-comcom-ai/014bef4dd9d04b25d8f4e2c7ab7ed9f8 to your computer and use it in GitHub Desktop.
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
# Create the report or replace the existing one | |
echo "Creating insight report" | |
echo "https://api.bitbucket.org/2.0/repositories/$BITBUCKET_REPO_FULL_NAME/commits/$BITBUCKET_COMMIT/reports/$REPORT_KEY" | |
curl \ | |
--proxy 'http://localhost:29418' \ | |
-H "Content-type: application/json" \ | |
-X PUT \ | |
-d @report.json \ | |
"https://api.bitbucket.org/2.0/repositories/$BITBUCKET_REPO_FULL_NAME/commits/$BITBUCKET_COMMIT/reports/$REPORT_KEY" | |
echo "Done" | |
# Delete old annotations from the report (they may not exist but it is better to be safe) | |
echo "Deleting any existing annotations" | |
curl \ | |
--proxy 'http://localhost:29418' \ | |
-H "X-Atlassian-Token: no-check" \ | |
-X DELETE \ | |
"https://api.bitbucket.org/2.0/repositories/$BITBUCKET_REPO_FULL_NAME/commits/$BITBUCKET_COMMIT/reports/$REPORT_KEY/annotations" | |
echo "Done" | |
# Create the annotations | |
echo "Adding annotations to report" | |
curl \ | |
--proxy 'http://localhost:29418' \ | |
-H "Content-type: application/json" \ | |
-X POST \ | |
-d @annotations.json \ | |
"https://api.bitbucket.org/2.0/repositories/$BITBUCKET_REPO_FULL_NAME/commits/$BITBUCKET_COMMIT/reports/$REPORT_KEY/annotations" | |
echo "Done" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment