This repository was archived by the owner on Jun 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathconfig.yml
More file actions
233 lines (225 loc) · 6.55 KB
/
config.yml
File metadata and controls
233 lines (225 loc) · 6.55 KB
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
defaults: &defaults
working_directory: ~/margarita
docker:
- image: circleci/node:10
version: 2
jobs:
install-dependencies:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: ~/margarita
- restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
- v1-dependencies-
- run:
name: Install Dependencies
command: yarn install --frozen-lockfile
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "yarn.lock" }}
- persist_to_workspace:
root: .
paths: .
flow:
<<: *defaults
steps:
- attach_workspace:
at: ~/margarita
- run: yarn flow
lint:
<<: *defaults
steps:
- attach_workspace:
at: ~/margarita
- run: yarn lint
unit-tests:
<<: *defaults
steps:
- attach_workspace:
at: ~/margarita
- restore_cache:
keys:
- v1-0-jest-cache-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-0-jest-cache-
- run:
name: Add .env file (react-native-dotenv)
command: cp .env-sample .env
- run: yarn test --ci --color --maxWorkers=2
- save_cache:
key: v1-0-jest-cache-{{ checksum "package.json" }}
paths:
- .jestCache
- persist_to_workspace:
root: .
paths: .
build-landing-page:
<<: *defaults
steps:
- attach_workspace:
at: ~/margarita
- run:
name: Build landing page
command: yarn workspace @kiwicom/margarita-landing-page build
- run:
name: Export landing page
command: yarn workspace @kiwicom/margarita-landing-page export
- persist_to_workspace:
root: .
paths: apps/landingPage/out
deploy-landing-page:
working_directory: ~/margarita
docker:
- image: circleci/python:2.7-jessie
steps:
- attach_workspace:
at: ~/margarita
- run:
name: Install awscli
command: sudo pip install awscli
- run:
name: Deploy to S3
command: AWS_ACCESS_KEY_ID=$ACCESS_KEY AWS_SECRET_ACCESS_KEY=$SECRET_KEY aws s3 sync apps/landingPage/out s3://margarita-landing-page/ --delete
deploy-graphql:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
- v1-dependencies-
- run:
name: Install Serverless CLI and dependencies
command: |
sudo npm i -g serverless
yarn install
- run:
name: Generate .env file for GraphQL
command: echo BASE_URL=$BASE_URL >> .env && echo API_KEY=$API_KEY >> .env
- run:
name: Copy .env file to graphql folder
command: cp ~/margarita/.env ~/margarita/apps/graphql
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "yarn.lock" }}
- run:
name: Deploy GraphQL lambda
command: yarn graphql:deploy
build-and-deploy-documentation:
<<: *defaults
steps:
- attach_workspace:
at: ~/margarita
- add_ssh_keys:
fingerprints:
- '56:b8:5a:30:ca:27:22:43:2d:9a:9e:42:4b:e6:a1:9a'
- run:
name: Adding GitHub to known_hosts
command: echo "github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==" >> ~/.ssh/known_hosts
- run:
name: Configure Git User
command: |
git config --global user.email "${GH_EMAIL}"
git config --global user.name "${GH_NAME}"
- run:
name: Deploy landing page
command: GIT_USER="${GH_USERNAME}" USE_SSH=true yarn workspace @kiwicom/margarita-docs deploy
publish-margarita-to-expo:
<<: *defaults
steps:
- attach_workspace:
at: ~/margarita
- run:
name: Add .env file (react-native-dotenv)
command: yarn create-dotenv
- run:
name: Login into Expo
command: npx expo login -u $EXPO_USERNAME -p $EXPO_PASSWORD
- run:
name: Publish to Expo
command: |
cd apps/mobile
npx expo publish --non-interactive --max-workers 1
publish-uc-storybook-to-expo:
<<: *defaults
steps:
- attach_workspace:
at: ~/margarita
- run:
name: Login into Expo
command: npx expo login -u $EXPO_USERNAME -p $EXPO_PASSWORD
- run:
name: Publish to Expo
command: |
cd apps/storybook
yarn rnstl:universal-components
npx expo publish --non-interactive --max-workers 1
workflows:
version: 2
test-and-release:
jobs:
- install-dependencies
- lint:
requires:
- install-dependencies
- flow:
requires:
- install-dependencies
- unit-tests:
requires:
- install-dependencies
- deploy-graphql:
requires:
- lint
- flow
- unit-tests
filters:
branches:
only: master
- build-landing-page:
requires:
- lint
- flow
- unit-tests
filters:
branches:
only: master
- deploy-landing-page:
requires:
- build-landing-page
filters:
branches:
only: master
- build-and-deploy-documentation:
requires:
- lint
- flow
- unit-tests
filters:
branches:
only: master
- publish-margarita-to-expo:
requires:
- lint
- flow
- unit-tests
filters:
branches:
only: master
- publish-uc-storybook-to-expo:
requires:
- lint
- flow
- unit-tests
filters:
branches:
only: master