-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcircle.yml
158 lines (137 loc) · 3.62 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
version: 2
defaults: &defaults
docker:
- image: circleci/node:10-browsers
environment:
JOBS: 2
restore_node: &restore_node
restore_cache:
key: v3-node10-yarn-deps-{{ arch }}-{{ checksum "yarn.lock" }}
restore_modernizr: &restore_modernizr
restore_cache:
key: modernizr-{{ .Revision }}
jobs:
install:
<<: *defaults
steps:
- checkout
- run:
name: Install grunt
command: yarn global add grunt-cli
- <<: *restore_node
- run:
name: Node dependencies
command: |
if [ ! -d ./node_modules ]; then
yarn --pure-lockfile
fi
- save_cache:
key: v3-node10-yarn-deps-{{ arch }}-{{ checksum "yarn.lock" }}
paths:
- node_modules
- <<: *restore_modernizr
- run:
name: Build modernizr
command: |
if [ ! -f vendor/modrnizr/modernizr-build.js ]; then
npx grunt modernizr:dist
fi
- save_cache:
key: modernizr-{{ .Revision }}
paths:
- vendor/modernizr/modernizr-build.js
test:
<<: *defaults
steps:
- checkout
- <<: *restore_node
- <<: *restore_modernizr
- run:
name: Test
environment:
CIRCLE_TEST_REPORTS: test-results
command: npx ember test
- store_test_results:
path: test-results/
deploy_production:
<<: *defaults
steps:
- checkout
- <<: *restore_node
- <<: *restore_modernizr
- run:
name: Deploy to production
command: |
env | sed -n 's/^DEPLOY_//p' > .env
env | sed -n 's/^PROD_//p' >> .env
npx ember deploy production --verbose --activate
deploy_demo:
<<: *defaults
steps:
- checkout
- <<: *restore_node
- <<: *restore_modernizr
- run:
name: Deploy to demo
command: |
env | sed -n 's/^DEPLOY_//p' > .env
env | sed -n 's/^DEMO_//p' >> .env
npx ember deploy demo --verbose --activate
deploy_qa:
<<: *defaults
steps:
- checkout
- <<: *restore_node
- <<: *restore_modernizr
- run:
name: Deploy QA build
command: |
env | sed -n 's/^DEPLOY_//p' > .env
env | sed -n 's/^DEMO_//p' >> .env
npx ember deploy qa:$QA_PREFIX/$CIRCLE_BRANCH --verbose --activate
- run:
name: Make QA artifact
command: |
mkdir /tmp/qa-builds
echo "<a href=\"https:$DEMO_WNYC_URL?build=$QA_PREFIX/$CIRCLE_BRANCH\">https:$DEMO_WNYC_URL?build=$QA_PREFIX/$CIRCLE_BRANCH</a>" > /tmp/qa-builds/$CIRCLE_SHA1.html
- store_artifacts:
path: /tmp/qa-builds
workflows:
version: 2
install-test-deploy:
jobs:
- install:
filters:
tags:
only: /.*/
- test:
filters:
tags:
only: /.*/
requires:
- install
- deploy_production:
requires:
- test
context: "AWS Deploy"
filters:
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+/
branches:
ignore: /.*/
- deploy_demo:
requires:
- test
context: "AWS Deploy"
filters:
tags:
only: demo
branches:
only: main
- deploy_qa:
requires:
- test
context: "AWS Deploy"
filters:
branches:
only: /[A-Za-z-_]+/[A-Za-z-_\d]+/