/
config.yml
198 lines (192 loc) · 5.34 KB
/
config.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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
defaults: &defaults
working_directory: ~/reg-suit
docker:
- image: quramy/node-nightmare
environment:
DISPLAY: ":99"
GOOGLE_APPLICATION_CREDENTIALS: "/root/gcloud-service-key.json"
version: 2
jobs:
build:
<<: *defaults
steps:
- checkout
- run:
name: setup GCP
command: echo $GCLOUD_SERVICE_KEY > /root/gcloud-service-key.json
- restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
- v1-dependencies-
- run:
name: Install dependencies
command: yarn --pure-lockfile
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "yarn.lock" }}
- run:
name: Bootstrap packages
command: yarn run bootstrap
- run:
name: Lint
command: yarn run lint
- run:
name: Test
command: |
xvfbd start
yarn run test
xvfbd stop
- run:
name: Regression using gh-io components
command: |
cd packages/reg-suit-toppage
npm run regression
patch_release:
<<: *defaults
steps:
- add-ssh-keys:
fingerprints:
- "9b:4a:d1:c6:ff:b7:49:b7:b7:bf:24:fb:b1:1e:bc:a6"
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
- v1-dependencies-
- run:
name: Install dependencies
command: yarn --pure-lockfile
- run:
name: Bootstrap packages
command: yarn run bootstrap
- run:
name: Setup git
command: |
git config --global user.email "yosuke.kurami@gmail.com"
git config --global user.name "Quramy"
- run:
name: Login npm
command: |
echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > ~/.npmrc
npm whoami
- run:
name: Deploy services
command: |
yarn run deploy
- run:
name: Publish to npm
command: |
yarn run lerna run prepublish
yarn run lerna publish -- --yes --cd-version="patch"
minor_release:
<<: *defaults
steps:
- add-ssh-keys:
fingerprints:
- "9b:4a:d1:c6:ff:b7:49:b7:b7:bf:24:fb:b1:1e:bc:a6"
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
- v1-dependencies-
- run:
name: Install dependencies
command: yarn --pure-lockfile
- run:
name: Bootstrap packages
command: yarn run bootstrap
- run:
name: Setup git
command: |
git config --global user.email "yosuke.kurami@gmail.com"
git config --global user.name "Quramy"
- run:
name: Login npm
command: |
echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > ~/.npmrc
npm whoami
- run:
name: Deploy services
command: |
cd packages/reg-gh-app
./node_modules/.bin/sls config credentials --provider aws --key ${AWS_ACCESS_KEY_ID} --secret ${AWS_SECRET_ACCESS_KEY}
cd ../../
yarn run deploy
- run:
name: Publish to npm
command: |
yarn run lerna run prepublish
yarn run lerna publish -- --yes --cd-version="minor"
deply_service:
<<: *defaults
steps:
- add-ssh-keys:
fingerprints:
- "9b:4a:d1:c6:ff:b7:49:b7:b7:bf:24:fb:b1:1e:bc:a6"
- run:
name: Setup git
command: |
git config --global user.email "yosuke.kurami@gmail.com"
git config --global user.name "Quramy"
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
- v1-dependencies-
- run:
name: Install dependencies
command: yarn --pure-lockfile
- run:
name: Bootstrap packages
command: yarn run bootstrap
- run:
name: Deploy services
command: |
cd packages/reg-gh-app
./node_modules/.bin/sls config credentials --provider aws --key ${AWS_ACCESS_KEY_ID} --secret ${AWS_SECRET_ACCESS_KEY}
cd ../../
yarn run deploy
workflows:
version: 2
reg_build_pipeline:
jobs:
- build
- confirm_patch:
type: approval
filters:
branches:
only: master
requires:
- build
- confirm_minor:
type: approval
filters:
branches:
only: master
requires:
- build
- confirm_deploy_services:
type: approval
filters:
branches:
only: master
requires:
- build
- patch_release:
filters:
branches:
only: master
requires:
- confirm_patch
- minor_release:
filters:
branches:
only: master
requires:
- confirm_minor
- deply_service:
filters:
branches:
only: master
requires:
- confirm_deploy_services