Skip to content

Commit

Permalink
#208 Check curl output to validate deploy trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
Ionut Prunache committed Oct 19, 2016
1 parent 608254a commit f6689ff
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,18 @@ fi
DEPLOY_PROJECT_ID=5804f143e8fe021000f9aed1

# Trigger Shippable to run the deploy project and pass the current project name, branch and latest commit
curl\
STATUS=$(curl -s\
-H "Authorization: apiToken $API_TOKEN"\
-H "Content-Type: application/json"\
-d "{\"branchName\":\"master\",\"globalEnv\": {\"PROJECT\":\"rp\", \"PROJECT_BRANCH\":\"$BRANCH\", \"PROJECT_COMMIT\":\"$COMMIT\"}}"\
"https://api.shippable.com/projects/$DEPLOY_PROJECT_ID/newBuild"
"https://api.shippable.com/projects/$DEPLOY_PROJECT_ID/newBuild")
echo "$STATUS"

if [[ "$STATUS" == *"runId"* ]]
then
echo "Deploy triggered successfully";
exit 0
else
echo "Failed to trigger deploy.";
exit 1
fi

0 comments on commit f6689ff

Please sign in to comment.