Browse Source

💚 another night test

main
Julien Dudek 6 years ago
parent
commit
f256fb61ad
  1. 56
      .circleci/config.yml

56
.circleci/config.yml

@ -23,8 +23,8 @@ jobs:
# Download and cache dependencies # Download and cache dependencies
- restore_cache: - restore_cache:
keys: keys:
- v2-dependencies-{{ checksum "requirements/dev.txt" }}
- v2-dependencies-
- v3-dependencies-{{ checksum "requirements/dev.txt" }}
- v3-dependencies-
# fallback to using the latest cache if no exact match is found # fallback to using the latest cache if no exact match is found
- run: - run:
@ -41,7 +41,7 @@ jobs:
- save_cache: - save_cache:
paths: paths:
- venv - venv
key: v2-dependencies-{{ checksum "requirements/dev.txt" }}
key: v3-dependencies-{{ checksum "requirements/dev.txt" }}
@ -67,18 +67,16 @@ jobs:
# Download and cache dependencies # Download and cache dependencies
- restore_cache: - restore_cache:
keys: keys:
- v2-dependencies-{{ checksum "requirements/dev.txt" }}
- v2-dependencies-
- v3-dependencies-{{ checksum "requirements/dev.txt" }}
- v3-dependencies-
# fallback to using the latest cache if no exact match is found # fallback to using the latest cache if no exact match is found
- run: - run:
name: db migrate
name: bd upgrade
command: | command: |
. venv/bin/activate . venv/bin/activate
sleep 1 sleep 1
flask db upgrade flask db upgrade
sleep 1
flask db migrate
environment: environment:
CONDUIT_SECRET: 'something-really-secret' CONDUIT_SECRET: 'something-really-secret'
FLASK_APP: /home/circleci/repo/autoapp.py FLASK_APP: /home/circleci/repo/autoapp.py
@ -93,42 +91,40 @@ jobs:
# other common Python testing frameworks include pytest and nose # other common Python testing frameworks include pytest and nose
# https://pytest.org # https://pytest.org
# https://nose.readthedocs.io # https://nose.readthedocs.io
# - run:
# name: run tests
# environment:
# CONDUIT_SECRET: 'something-really-secret'
# FLASK_APP: /home/circleci/repo/autoapp.py
# FLASK_DEBUG: 1
# DATABASE_URL: postgresql://myUsr:somePwd@localhost:5432/myUsr
# command: |
# . venv/bin/activate
# sleep 1
# flask test
- run:
name: run tests
command: |
. venv/bin/activate
flask test
environment:
CONDUIT_SECRET: 'something-really-secret'
FLASK_APP: /home/circleci/repo/autoapp.py
FLASK_DEBUG: 1
DATABASE_URL: postgresql://myUsr:somePwd@localhost:5432/myUsr
- save_cache: - save_cache:
paths: paths:
- venv - venv
key: v2-dependencies-{{ checksum "requirements/dev.txt" }}
key: v3-dependencies-{{ checksum "requirements/dev.txt" }}
back-deploy-heroku: back-deploy-heroku:
docker: docker:
- image: buildpack-deps:trusty - image: buildpack-deps:trusty
steps: steps:
- checkout - checkout
- run: - run:
name: Heroku Deploy (main)
command: |
echo $HEROKU_APP_NAME
git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git main
name: Heroku Deploy
command: git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git main
- run: - run:
name: Smoke Test name: Smoke Test
environment:
HEROKU_APP_NAME: devops-final-back-2020-2021
command: | command: |
HTTPCODE=`curl -s -o /dev/null -w "%{http_code}" https://$HEROKU_APP_NAME.herokuapp.com/api/articles` 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
if [ "$HTTPCODE" -ne 200 ]; then
echo "heroku app not responding, failing deploy"
exit 1
fi
workflows: workflows:
version: 2 version: 2
build-back-deploy: build-back-deploy:

Loading…
Cancel
Save