From f256fb61adbb675ce36c3e800aba6b7a3ca35ce0 Mon Sep 17 00:00:00 2001 From: Julien Dudek Date: Wed, 6 Jan 2021 00:49:30 +0100 Subject: [PATCH] :green_heart: another night test --- .circleci/config.yml | 56 ++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 30d95a4..ea306d8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,8 +23,8 @@ jobs: # Download and cache dependencies - restore_cache: 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 - run: @@ -41,7 +41,7 @@ jobs: - save_cache: paths: - venv - key: v2-dependencies-{{ checksum "requirements/dev.txt" }} + key: v3-dependencies-{{ checksum "requirements/dev.txt" }} @@ -67,18 +67,16 @@ jobs: # Download and cache dependencies - restore_cache: 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 - run: - name: db migrate + name: bd upgrade command: | . venv/bin/activate sleep 1 flask db upgrade - sleep 1 - flask db migrate environment: CONDUIT_SECRET: 'something-really-secret' FLASK_APP: /home/circleci/repo/autoapp.py @@ -93,42 +91,40 @@ jobs: # other common Python testing frameworks include pytest and nose # https://pytest.org # 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: paths: - venv - key: v2-dependencies-{{ checksum "requirements/dev.txt" }} + key: v3-dependencies-{{ checksum "requirements/dev.txt" }} + back-deploy-heroku: docker: - image: buildpack-deps:trusty steps: - checkout + - 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: name: Smoke Test - environment: - HEROKU_APP_NAME: devops-final-back-2020-2021 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 + if [ "$HTTPCODE" -ne 200 ]; then + echo "heroku app not responding, failing deploy" + exit 1 + fi workflows: version: 2 build-back-deploy: