-
Notifications
You must be signed in to change notification settings - Fork 481
/
config.yml
237 lines (203 loc) · 7.36 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
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
234
235
236
237
experimental:
notify:
branches:
only:
- staging
- staging-next
version: 2
jobs:
build:
# No Circle builds on pipeline branches because we depend on
# our own infrastructure for these parts of our deploy process.
branches:
ignore:
- production
- test
- levelbuilder
- /dtp_candidate_.*/
- /dtl_candidate_.*/
parallelism: 2
docker:
- image: jmkulwik/code-dot-org:0.7
environment:
RAILS_ENV: test
RACK_ENV: test
CIRCLE_TEST_REPORTS: /home/circleci/project/test_reports
CIRCLE_ARTIFACTS: /home/circleci/project/artifacts
DISABLE_SPRING: 1
LD_LIBRARY_PATH: /usr/local/lib
- image: iynere/redis:2.8.4
resource_class: xlarge
steps:
- run:
name: Create source cache key
command: "date +%D > /home/circleci/today.date"
# cache source
- restore_cache:
keys:
- code-dot-org-source-v7-{{ checksum "/home/circleci/today.date" }}
- code-dot-org-source-v7-
- checkout
- run:
name: merge staging
command: bin/circle/merge-base
- save_cache:
key: code-dot-org-source-v7-{{ checksum "/home/circleci/today.date" }}
paths:
- ".git"
- run:
name: setup tests/artifacts dirs
command: |
mkdir /home/circleci/project/artifacts
touch /home/circleci/project/artifacts/sc.log
- run:
name: taking these out of dockerfile to see if that fixes build issues
command: |
sudo mv /usr/bin/parallel /usr/bin/gnu_parallel
sudo apt-get update
sudo apt-get install -y libicu-dev enscript moreutils pdftk libmysqlclient-dev libsqlite3-dev
wget https://github.com/htacg/tidy-html5/releases/download/5.4.0/tidy-5.4.0-64bit.deb && sudo dpkg -i tidy-5.4.0-64bit.deb
sudo mv /usr/bin/gnu_parallel /usr/bin/parallel
# restore gems cache
- restore_cache:
key: code-dot-org-bundle-v7-{{ checksum "Gemfile.lock" }}
# as recommended: https://circleci.com/docs/2.0/yarn/
- restore_cache:
name: Restore Yarn Package Cache
keys:
- yarn-packages-{{ .Branch }}-{{ checksum "apps/yarn.lock" }}
- yarn-packages-{{ .Branch }}
- yarn-packages-production
- yarn-packages-
# start mysql
- run: sudo service mysql start && mysql -V
- run:
name: install dependencies
command: |
bundle check --path=/home/circleci/project/vendor/bundle || bundle install --deployment --path=/home/circleci/project/vendor/bundle --jobs=4 --retry=3 --without ''
- run:
name: set yarn version
command: sudo apt-get install yarn=1.16.0-1
- run:
name: setup locals.yml
command: |
echo "
bundler_use_sudo: false
properties_encryption_key: $PROPERTIES_ENCRYPTION_KEY
applitools_eyes_api_key: $APPLITOOLS_KEY
cloudfront_key_pair_id: $CLOUDFRONT_KEY_PAIR_ID
cloudfront_private_key: \"$CLOUDFRONT_PRIVATE_KEY\"
saucelabs_username: $SAUCE_USERNAME
saucelabs_authkey: $SAUCE_ACCESS_KEY
ignore_eyes_mismatches: true
disable_all_eyes_running: true
firebase_name: $FIREBASE_NAME
firebase_secret: $FIREBASE_SECRET
use_my_apps: true
use_my_shared_js: true
build_blockly_core: true
build_shared_js: true
build_dashboard: true
build_pegasus: true
build_apps: true
localize_apps: true
dashboard_enable_pegasus: true
dashboard_workers: 5
skip_seed_all: true
google_maps_api_key: boguskey
" >> locals.yml
- run:
name: rake install
command: |
mispipe "bundle exec rake install" "ts '[%Y-%m-%d %H:%M:%S]'"
environment:
RAKE_VERBOSE: true
- save_cache:
key: code-dot-org-bundle-v7-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
# bump timeout
- run:
name: rake build
command: |
mispipe "bundle exec rake build --trace" "ts '[%Y-%m-%d %H:%M:%S]'"
environment:
RAKE_VERBOSE: true
# as recommended: https://circleci.com/docs/2.0/yarn/
- save_cache:
name: Save Yarn Package Cache
key: yarn-packages-{{ .Branch }}-{{ checksum "apps/yarn.lock" }}
paths:
- apps/node_modules/
- /home/circleci/.cache/yarn
- run:
name: firebase stuff
command: |
bundle exec rake firebase:ci
bundle exec rake circle:check_for_unexpected_apps_changes
- run:
name: unit tests
command: bundle exec rake circle:run_tests --trace
no_output_timeout: 40m
- run:
name: apply test settings for after unit tests
command: |
echo "
no_https_store: true
override_dashboard: \"localhost-studio.code.org\"
override_pegasus: \"localhost.code.org\"
dashboard_port: 3000
pegasus_port: 3000
animations_s3_directory: animations_circle/$CIRCLE_BUILD_NUM
assets_s3_directory: assets_circle/$CIRCLE_BUILD_NUM
files_s3_directory: files_circle/$CIRCLE_BUILD_NUM
sources_s3_directory: sources_circle/$CIRCLE_BUILD_NUM
" >> locals.yml
- restore_cache:
keys:
- code-dot-org-ui-test-data-v3-{{ .Branch }}-
- code-dot-org-ui-test-data-v3-staging-
- code-dot-org-ui-test-data-v3-
- run:
name: seed ui tests
command: bundle exec rake circle:seed_ui_test
no_output_timeout: 20m
- save_cache:
key: code-dot-org-ui-test-data-v3-{{ .Branch }}-{{ .Revision }}
paths:
- "dashboard/db/ui_test_data.commit"
- "dashboard/db/ui_test_data.sql"
- run:
name: run ui tests
command: |
bundle exec rake circle:run_ui_tests --trace
no_output_timeout: 20m
- run:
name: Cookbook integration tests (if branch name matches cookbook name)
command: cookbooks/test.sh
- run:
name: deployment
command: |
if [ "${CIRCLE_BRANCH}" == "production" ]; then
cd apps && npm run storybook:deploy
fi
- store_artifacts:
path: /home/circleci/project/artifacts
destination: artifacts
- store_artifacts:
path: /home/circleci/project/apps/log
destination: apps-test-logs
- store_artifacts:
path: /home/circleci/project/apps/yarn-error.log
destination: errors
- store_artifacts:
path: /home/circleci/project/dashboard/test/ui/log
destination: ui-test-logs
- store_artifacts:
path: /home/circleci/project/dashboard/log
destination: dashboard-server-logs
- store_artifacts:
path: /home/circleci/project/pegasus/log
destination: pegasus-server-logs
- store_test_results:
path: /home/circleci/project/test_reports