trigger-growi-docs.sh 570 B

12345678910111213141516171819202122232425262728
  1. #!/bin/sh
  2. # Trigger a new run
  3. # see: http://devcenter.wercker.com/docs/api/endpoints/runs#trigger-a-run
  4. # exec curl
  5. #
  6. # require
  7. # - $WERCKER_TOKEN
  8. # - $GROWI_DOCS_PIPELINE_ID
  9. #
  10. RESPONSE=`curl -X POST \
  11. -H "Content-Type: application/json" \
  12. -H "Authorization: Bearer $WERCKER_TOKEN" \
  13. https://app.wercker.com/api/v3/runs -d '{ \
  14. "pipelineId": "'$GROWI_DOCS_PIPELINE_ID'", \
  15. "branch": "master"
  16. }' \
  17. `
  18. echo $RESPONSE | jq .
  19. # get wercker run id
  20. RUN_ID=`echo $RESPONSE | jq .id`
  21. # exit with failure status
  22. if [ "$RUN_ID" = "null" ]; then
  23. exit 1
  24. fi