Browse Source

🔧 add testbackend.sh file in order to test the back-end code deploy

main
tchawou-daniel 6 years ago
parent
commit
66c90fc167
  1. 3
      .circleci/config.yml
  2. 5
      testbackend.sh

3
.circleci/config.yml

@ -77,6 +77,9 @@ jobs:
- run:
name: Heroku Deploy
command: git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git HEAD:main
- run:
name: Smoke test
command: ./testbackend.sh
buildandpush_dockerhub:
docker:
- image: docker:17.05.0-ce-git

5
testbackend.sh

@ -0,0 +1,5 @@
HTTPCODE=$(echo `curl -s -o /dev/null -w "%{http_code}" https://$HEROKU_APP_NAME.herokuapp.com/api/articles` | tr -d ' ')
if [ "$HTTPCODE" -ne 200 ];then
echo "heroku app not responding, failing deploy"
exit 1
fi
Loading…
Cancel
Save