-
Notifications
You must be signed in to change notification settings - Fork 53
/
after.sh
executable file
·28 lines (24 loc) · 1002 Bytes
/
after.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
# The required environment variables are:
# user - e.g. 'pjmhill'
# optional variables for github commit status API
# github_token - the token that is used to push commit status
# Instructions: https://sagebionetworks.jira.com/wiki/display/PLFM/Developer+Bootstrap#DeveloperBootstrap-PushPrivateJenkinsBuildStatustoGithubasCommitStatus
# require to check status
# result - the result of the docker_build.sh
# map Jenkins status to github commit status
if [[ $result -eq 0 ]]
then
export STATUS="success"
else
export STATUS="failure"
fi
# push build status to github
if [[ ${github_token} ]]
then
curl "https://api.github.com/repos/Sage-Bionetworks/Synapse-Repository-Services/statuses/$GIT_COMMIT" \
-H "Authorization: token ${github_token}" \
-H "Content-Type: application/json" \
-X POST \
-d "{\"state\": \"$STATUS\", \"description\": \"Jenkins\", \"target_url\": \"http://build-system-synapse.sagebase.org:8081/job/${stack}${user}/$BUILD_NUMBER/console\"}"
fi