forked from koding/koding
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
201 lines (159 loc) · 5.69 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
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
version: 2
executorType: docker
containerInfo:
- image: koding/circle@sha256:9e17db94f3c4b9d91b593db926111f7f78626ed0ba4209a47ae1980ffe1dce77
- image: mongo:3.2.8
cmd: ["--nojournal", "--noprealloc", "--smallfiles"]
- image: koding/postgres
- image: rabbitmq:3
- image: redis
stages:
build:
workDir: ~/koding
steps:
- type: checkout
- type: cache-restore
keys:
- node_modules-{{ checksum "package.json" }}
- type: cache-restore
keys:
- client-node_modules-{{ checksum "client/package.json" }}
- type: cache-restore
keys:
- landing-node_modules-{{ checksum "client/landing/package.json" }}
- type: shell
name: npm install
command: npm install --unsafe-perm
- type: cache-save
key: node_modules-{{ checksum "package.json" }}
paths:
- node_modules
- type: cache-save
key: client-node_modules-{{ checksum "client/package.json" }}
paths:
- client/node_modules
- type: cache-save
key: landing-node_modules-{{ checksum "client/landing/package.json" }}
paths:
- client/landing/node_modules
- type: shell
name: coffeelint
command: $(npm bin)/coffeelint --quiet .
- type: shell
name: credentials
command: |
export BRANCH=$CIRCLE_BRANCH
scripts/copy-deployment-credentials.sh
- type: shell
name: configure
command: ./configure --config dev --host dev.koding.com:8090 --hostname dev.koding.com
- type: shell
name: launch test hosts
command: |
chmod 600 scripts/test-instance/koding-test-instances-2015-06.pem
./run exec scripts/test-instance/launch --branch $CIRCLE_BRANCH --commit $CIRCLE_SHA1 | tee INSTANCE_DATA
- type: shell
name: check remote API consistency
command: ./run exec scripts/api-generator.coffee --check
- type: shell
name: check client code quality
command: scripts/check_client_code_quality.sh
- type: cache-restore
keys:
- client-happypack-{{ .Branch }}-{{ .Revision }}
- client-happypack-{{ .Branch }}
- client-happypack-master
- type: shell
name: build client
command: make -C client dist
- type: shell
name: sync website assets
command: |
[[ -z "$AWS_ACCESS_KEY" || -z "$AWS_ACCESS_SECRET_KEY" ]] && exit 0
s3cmd sync --access_key=$AWS_ACCESS_KEY --secret_key=$AWS_ACCESS_SECRET_KEY \
--no-mime-magic --guess-mime-type --acl-public \
website/a/p/p/$(git rev-parse --short HEAD)/ \
s3://koding-assets/a/p/p/$(git rev-parse --short HEAD)/
- type: cache-save
key: client-happypack-{{ .Branch }}-{{ .Revision }}-{{ epoch }}
paths:
- client/.happypack
- type: cache-save
key: client-happypack-{{ .Branch }}-{{ epoch }}
paths:
- client/.happypack
- type: cache-restore
keys:
- go-{{ .Branch }}-{{ .Revision }}
- go-{{ .Branch }}
- go-master
- type: shell
name: go build
command: go/build.sh
- type: cache-save
key: go-{{ .Branch }}-{{ .Revision }}-{{ epoch }}
paths:
- go/bin
- go/pkg
- type: cache-save
key: go-{{ .Branch }}-{{ epoch }}
paths:
- go/bin
- go/pkg
- type: shell
name: check kite configuration
command: ./run exec scripts/gotests.sh kites koding/kites/config
- type: shell
name: check generated JSON files
command: ./run exec scripts/check-generated-files.sh
- type: shell
name: test kites
command: ./run exec go/src/koding/kites/e2etest/e2etest.sh
- type: shell
name: test klient
command: ./run exec scripts/test-klient.sh
- type: shell
name: test kd
command: ./run exec scripts/test-kd.sh
- type: shell
name: test kontrol
command: ./run exec scripts/gotests.sh koding/kites/kontrol/kontrol
- type: shell
name: test kloud
command: ./run exec scripts/gotests.sh kites \
koding/kites/kloud/provider/... koding/kites/kloud/credential/... \
koding/kites/kloud/stack/... koding/kites/kloud/kloud/...
- type: shell
name: test mongo models
command: ./run exec go test koding/db/mongodb/modelhelper
- type: shell
name: run database migration
command: ./run migrations up
- type: shell
name: run
command: |
./run exec supervisord -c supervisord.conf
nginx -c $(pwd)/nginx.conf
./run health-check 30 600
- type: shell
name: test social API
environment:
EXTRAS: -convey-story=true
command: ./run exec make -C go/src/socialapi testapi
- type: shell
name: test web server
command: ./run exec scripts/node-testing/mocha-runner servers/lib/server
- type: shell
name: test social worker
command: ./run exec scripts/node-testing/mocha-runner workers/social/lib/social
- type: shell
name: run test suites
command: |
./run exec scripts/test-instance/check-connectivity INSTANCE_DATA circle-build-$CIRCLE_BUILD_NUM
./run exec scripts/ci/run-tests INSTANCE_DATA
status=$?
[[ $status -eq 0 ]] && ./run exec scripts/test-instance/cleanup INSTANCE_DATA
- type: shell
name: codecov
command: |
[[ -n "$CODECOV_TOKEN" ]] && bash <(curl --silent https://codecov.io/bash) -X gcov -X fix || exit 0