Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 37 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
version: 2
version: 2.1

#########
# Common
#########
orbs:
heroku: circleci/heroku@1.0.1

############
# Workflows
############
workflows:
version: 2
build-deploy:
jobs:
- build
- deploy:
requires:
- build
filters:
branches:
only: master

##################
# Job Definitions
##################
jobs:
build:
docker:
Expand All @@ -24,17 +49,14 @@ jobs:
java -jar selenium-server-standalone-3.5.3.jar -log test-reports/selenium.log
background: true
- restore_cache:
key: deps2-{{ .Branch }}-{{ checksum "requirements/dev.txt" }}
key: deps2-{{ checksum "requirements/dev.txt" }}
- run:
command: |
python3 -m venv venv
. venv/bin/activate
pip install -r requirements/dev.txt
- run:
name: setup Heroku
command: bash .circleci/setup-heroku.sh
- save_cache:
key: deps2-{{ .Branch }}-{{ checksum "requirements/dev.txt" }}
key: deps2-{{ checksum "requirements/dev.txt" }}
paths:
- 'venv'
- run:
Expand All @@ -46,14 +68,15 @@ jobs:
destination: tr1
- store_test_results:
path: test-reports/

deploy:
executor: heroku/default
steps:
- checkout
- add_ssh_keys:
fingerprints:
- '48:a0:87:54:ca:75:32:12:c6:9e:a2:77:a4:7a:08:a4'
- deploy:
name: Deploy Master to Heroku
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
git push heroku master
heroku run python manage.py deploy
heroku restart
fi
- heroku/install
- heroku/deploy-via-git:
force: true