diff --git a/.circleci/config.yml b/.circleci/config.yml index 7de6a11..4e17f1f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,7 +21,7 @@ jobs: - image: circleci/python:3.7.4 environment: DATABASE_URL: postgresql://myuser:somePwd@localhost:5432/myuser - - image: circleci/postgres:9.6.5-alpine-ram + - image: circleci/postgres:9.6.5 environment: POSTGRES_DB: myuser POSTGRES_USER: myuser @@ -48,6 +48,23 @@ jobs: . venv/bin/activate sleep 1 flask test + 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 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 + workflows: version: 2.1 @@ -57,4 +74,6 @@ workflows: - initialise: requires: - build - + - back-deploy-heroku: + requires: + - docker-build-and-push \ No newline at end of file