Skip to content

Commit da7d658

Browse files
author
Michael Thanh
authored
Refactor/pipelines (#22)
* Update YAML to use pipelines * Force changes in deploy * Only push to heroku master on master branch * Change workflow name to build-deploy
1 parent b16a867 commit da7d658

File tree

1 file changed

+37
-14
lines changed

1 file changed

+37
-14
lines changed

.circleci/config.yml

+37-14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
1-
version: 2
1+
version: 2.1
2+
3+
#########
4+
# Common
5+
#########
6+
orbs:
7+
heroku: circleci/[email protected]
8+
9+
############
10+
# Workflows
11+
############
12+
workflows:
13+
version: 2
14+
build-deploy:
15+
jobs:
16+
- build
17+
- deploy:
18+
requires:
19+
- build
20+
filters:
21+
branches:
22+
only: master
23+
24+
##################
25+
# Job Definitions
26+
##################
227
jobs:
328
build:
429
docker:
@@ -24,17 +49,14 @@ jobs:
2449
java -jar selenium-server-standalone-3.5.3.jar -log test-reports/selenium.log
2550
background: true
2651
- restore_cache:
27-
key: deps2-{{ .Branch }}-{{ checksum "requirements/dev.txt" }}
52+
key: deps2-{{ checksum "requirements/dev.txt" }}
2853
- run:
2954
command: |
3055
python3 -m venv venv
3156
. venv/bin/activate
3257
pip install -r requirements/dev.txt
33-
- run:
34-
name: setup Heroku
35-
command: bash .circleci/setup-heroku.sh
3658
- save_cache:
37-
key: deps2-{{ .Branch }}-{{ checksum "requirements/dev.txt" }}
59+
key: deps2-{{ checksum "requirements/dev.txt" }}
3860
paths:
3961
- 'venv'
4062
- run:
@@ -46,14 +68,15 @@ jobs:
4668
destination: tr1
4769
- store_test_results:
4870
path: test-reports/
71+
72+
deploy:
73+
executor: heroku/default
74+
steps:
75+
- checkout
4976
- add_ssh_keys:
5077
fingerprints:
5178
- '48:a0:87:54:ca:75:32:12:c6:9e:a2:77:a4:7a:08:a4'
52-
- deploy:
53-
name: Deploy Master to Heroku
54-
command: |
55-
if [ "${CIRCLE_BRANCH}" == "master" ]; then
56-
git push heroku master
57-
heroku run python manage.py deploy
58-
heroku restart
59-
fi
79+
- heroku/install
80+
- heroku/deploy-via-git:
81+
force: true
82+

0 commit comments

Comments
 (0)