From 36813e9637d76409a89d4de17a8a13d0ee806550 Mon Sep 17 00:00:00 2001 From: johanna Date: Wed, 12 Jan 2022 14:09:36 -0800 Subject: [PATCH] new config 2022 --- .circleci/config.yml | 62 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 55 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2547802..092a151 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,10 +1,11 @@ version: 2.1 orbs: - python: circleci/python@1.0.0 + python: circleci/python@1.5.0 + heroku: circleci/heroku@1.2.6 jobs: - build: + build_and_test: # this can be any name you choose docker: - - image: cimg/python:3.6.10 + - image: cimg/python:3.10.1 environment: DATABASE_URL: postgresql://root@localhost/circle_test?sslmode=disable - image: circleci/postgres:9.6.2 @@ -13,13 +14,60 @@ jobs: POSTGRES_DB: circle_test steps: - checkout - - python/install-packages + - python/install-packages: + pkg-manager: pip - run: - name: Run django tests - command: | - pipenv run python manage.py test + name: Run tests + command: pipenv run python manage.py test # alternatively run `python -m pytest` if you are running vanilla pytest - store_test_results: path: test-results - store_artifacts: path: test-results destination: tr1 + - persist_to_workspace: + root: ~/project + paths: + - . + + deploy: # this can be any name you choose + docker: + - image: cimg/python:3.10.1 + steps: + - attach_workspace: + at: ~/project + - heroku/deploy-via-git: + force: true # force push when pushing to the heroku remote, see: https://devcenter.heroku.com/articles/git + +workflows: + on_commit: + jobs: + - build_and_test + # Follow instructions here to authenticate git for Heroku: https://devcenter.heroku.com/articles/git#http-git-authentication + # The following code may be uncommented, onnce HEROKU_API_KEY & HEROKU_APP_NAME environemnt variables are present + # Read more: https://circleci.com/docs/2.0/env-vars/ + # - deploy: + # requires: + # - build_and_test # only deploy if the build_and_test job has completed + # filters: + # branches: + # only: master # only deploy when on main/master + nightly: + triggers: + - schedule: + cron: "0 0 * * *" + filters: + branches: + only: + - master + jobs: + - build_and_test + # Follow instructions here to authenticate git for Heroku: https://devcenter.heroku.com/articles/git#http-git-authentication + # The following code may be uncommented, onnce HEROKU_API_KEY & HEROKU_APP_NAME environemnt variables are present + # Read more: https://circleci.com/docs/2.0/env-vars/ + # - deploy: + # requires: + # - build_and_test # only deploy if the build_and_test job has completed + # filters: + # branches: + # only: master # only deploy when on main/master +2:06