Browse Source

make it better

mytest-branch
tchawou-daniel 6 years ago
parent
commit
6761e39684
  1. 23
      .circleci/config.yml

23
.circleci/config.yml

@ -21,7 +21,7 @@ jobs:
- image: circleci/python:3.7.4 - image: circleci/python:3.7.4
environment: environment:
DATABASE_URL: postgresql://myuser:somePwd@localhost:5432/myuser DATABASE_URL: postgresql://myuser:somePwd@localhost:5432/myuser
- image: circleci/postgres:9.6.5-alpine-ram
- image: circleci/postgres:9.6.5
environment: environment:
POSTGRES_DB: myuser POSTGRES_DB: myuser
POSTGRES_USER: myuser POSTGRES_USER: myuser
@ -48,6 +48,23 @@ jobs:
. venv/bin/activate . venv/bin/activate
sleep 1 sleep 1
flask test 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: workflows:
version: 2.1 version: 2.1
@ -57,4 +74,6 @@ workflows:
- initialise: - initialise:
requires: requires:
- build - build
- back-deploy-heroku:
requires:
- docker-build-and-push
Loading…
Cancel
Save