From ef3c056db5e6a421cac0062ce18077c17b2e274f Mon Sep 17 00:00:00 2001 From: Tristan Date: Sun, 17 Jan 2021 18:59:37 +0100 Subject: [PATCH] :wrench: add test_heroku / modif config.yml --- .circleci/config.yml | 13 +++---------- test_heroku.sh | 8 ++++++++ 2 files changed, 11 insertions(+), 10 deletions(-) create mode 100644 test_heroku.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index d2a1a51..440ebec 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -50,17 +50,12 @@ jobs: - checkout - run: name: Deploy main to heroku - command: | - git config --global push.default matching - git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git main + command: + git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git HEAD:master - run: name: Smoke test command: | - HTTPCODE=`curl -s -o /dev/null -w "%{http_code}" https://$HEROKU_APP_NAME.herokuapp.com/api/articles` - if [ "$HTTPCODE" -ne 200 ];then - echo "heroku app not responding, failing deploy" - exit 1 - fi + ./test_heroku.sh docker-build-push: working_directory: /dockerapp docker: @@ -91,9 +86,7 @@ workflows: context: Heroku requires: - build - # - test (We don't require test as there's a problem with them atm) - docker-build-push: context: Docker requires: - build - # - test (We don't require test as there's a problem with them atm) diff --git a/test_heroku.sh b/test_heroku.sh new file mode 100644 index 0000000..6b7ea3f --- /dev/null +++ b/test_heroku.sh @@ -0,0 +1,8 @@ + +#!/bin/bash +HEROKU_APP_NAME="calm-crag-04725" +HTTPCODE=`curl -s -o /dev/null -w "%{http_code}" https://$HEROKU_APP_NAME.herokuapp.com/` +if [ "$HTTPCODE" -ne 200 ];then + echo "heroku app not responding, failing deploy" + exit 1 +fi \ No newline at end of file