-
Notifications
You must be signed in to change notification settings - Fork 479
/
config.yml
218 lines (184 loc) · 6.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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
experimental:
notify:
branches:
only:
- staging
- staging-next
version: 2
jobs:
build:
parallelism: 2
docker:
- image: wjordan/code-dot-org:trusty
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
sudo mv /usr/bin/gnu_parallel /usr/bin/parallel
# restore gems cache
- restore_cache:
key: code-dot-org-bundle-v6-{{ checksum "Gemfile.lock" }}
# restore npm cache
- restore_cache:
keys:
- code-dot-org-node-v8-{{ checksum "apps/package.json" }}
- code-dot-org-node-v8-
# 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: setup locals.yml
command: |
echo "
bundler_use_sudo: false
properties_encryption_key: $PROPERTIES_ENCRYPTION_KEY
applitools_eyes_api_key: $APPLITOOLS_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
" >> locals.yml
yarn -V
- run:
name: fix weird gem issue
command: |
bundle exec gem install rmagick
bundle update rmagick
sudo ldconfig /usr/local/lib
- 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-v6-{{ 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]'"
- save_cache:
key: code-dot-org-node-v8-{{ checksum "apps/package.json" }}
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
" >> 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
cookbooks/test.sh
no_output_timeout: 20m
- 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/coverage
destination: coverage
- 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