From df3b62ecd6f5449359be6ca4d793d87e39092e71 Mon Sep 17 00:00:00 2001 From: shootylife Date: Sat, 16 Jan 2021 14:29:29 +0100 Subject: [PATCH] :construction_worker: back deploy on heroku --- .circleci/config.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fe06fb2..0ebc608 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,7 @@ workflows: devopsTP4: jobs: - install - + - back-deploy-heroku jobs: install: docker: @@ -56,3 +56,19 @@ jobs: - run: docker container stop flask_db_test - run: docker container rm flask_db_test - run: unset DATABASE_URL + back-deploy-heroku: + docker: + - image: buildpack-deps:trusty + steps: + - checkout + - 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: | + HTTPCODE=`curl -s -o /dev/null -w "%{http_code}" https://devops-back-final.herokuapp.com//` + if [[ "$HTTPCODE" -ne 200 ]]; then + echo "heroku app not responding, failing deploy" \ + exit 1; \ + fi