-
Notifications
You must be signed in to change notification settings - Fork 17
/
.gitlab-ci.yml
240 lines (226 loc) · 5.36 KB
/
.gitlab-ci.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
238
239
240
image: docker.slock.it/build-images/node:11-alpine
variables:
COMMIT_IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
RELEASE_IMAGE_TAG: $CI_REGISTRY_IMAGE:latest
stages:
- build
- test
- deploy
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
build-in3:
stage: build
tags:
- short-jobs
script:
- sh /prepare.sh
- npm install
- npm run build
artifacts:
paths:
- js/
test-in3:
stage: test
tags:
- short-jobs
script:
- sh /prepare.sh
- npm install
- npm test
# test-in3-parity:
# stage: test
# tags:
# - short-jobs
# variables:
# RPCURL: http://parity:8545
# IPFS_URL: http://ipfs:5001
# services:
# - name: jbenet/go-ipfs:latest
# command:
# - daemon
# - --offline
# alias: ipfs
# - name: docker.slock.it/core-technology/parity-timemachine:master
# alias: parity
# script:
# - sh /prepare.sh
# - npm install
# - npm run build
# - npm test
# - rm -rf in3-server; git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@git.slock.it/in3/ts/in3-server.git -b develop --single-branch
# - cd in3-server
# - npm install
# - cd node_modules
# - rm -rf in3
# - ln -s ../../ in3
# - cd ..
# - npm run build
# - npm test
# test-in3-geth:
# stage: test
# tags:
# - short-jobs
# variables:
# RPCURL: http://geth:8545
# IPFS_URL: http://ipfs:5001
# services:
# - name: jbenet/go-ipfs:latest
# command:
# - daemon
# - --offline
# alias: ipfs
# - name: docker.slock.it/core-technology/geth-timemachine:master
# alias: geth
# script:
# - sh /prepare.sh
# - npm install
# - npm run build
# - npm test
# - rm -rf in3-server; git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@git.slock.it/in3/ts/in3-server.git -b develop --single-branch
# - cd in3-server
# - npm install
# - cd node_modules
# - rm -rf in3
# - ln -s ../../ in3
# - cd ..
# - npm run build
# - npm test
artifacts:
name: "test-reports-$CI_JOB_NAME"
paths:
- test/report
test-implementation:
stage: test
tags:
- short-jobs
script:
- sh /prepare.sh
- npm install
- npm run build
- npm test
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@git.slock.it/in3/ts/in3-implementation-tests.git
- cd in3-implementation-tests
- npm install
- cd node_modules
- ln -s ../../ in3
- cd ..
- npm run build-ts
# - npm test; echo "done"
test-in3-examples:
stage: test
tags:
- short-jobs
script:
- sh /prepare.sh
- cd examples/
- npm install
- rm -rf node_modules/in3
- cd ..
- npm i && npm run build
- mkdir examples/node_modules/in3
- cp -r `ls -A | grep -v "examples"` examples/node_modules/in3/
- cd examples/
- npm run start
test-usn-lib:
stage: test
tags:
- short-jobs
allow_failure: true
variables:
RPCURL: http://parity:8545
USN_TESTMODE: parity
TEST_RESULTS: test/results/parity/
TEST_SCOPE: short
services:
- name: parity/parity:stable
command:
- --jsonrpc-experimental
- --jsonrpc-apis=all
- --logging=3
- --jsonrpc-interface=all
- --ws-interface=all
- --chain=dev
- --gas-cap=8000000
- --gasprice=0
- --reseal-min-period=0
- --gas-floor-target=8700000
- --tracing=on
alias: parity
script:
- sh /prepare.sh
- npm install
- npm run build
- cd ..
- rm -rf usn-testing
- mkdir usn-testing
- cd usn-testing
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@git.slock.it/iotlayer/usn-lib.git --single-branch
- cd usn-lib
- npm install
- rm -rf node_modules/in3
- cd node_modules
- ln -s /builds/in3/ts/in3 in3
- cd ..
# - npm run build
# - npm test; echo "done"
# - cd ..
# - rm -rf usn-testing
# pages:
# stage: deploy
# tags:
# - short-jobs
# environment:
# name: test-results
# url: http://in3.git-pages.slock.it/in3
# dependencies:
# - test-in3-parity
# - test-in3-geth
# script:
# - mkdir -p public/
# - cp -r test/report/* public/
# artifacts:
# paths:
# - public
deploy-to-slockit-npm:
stage: deploy
tags:
- short-jobs
only: # deploy only on semantic versions tags
- /^v[0-9]*\.[0-9]*\.[0-9]*-?.*$/
except:
- branches
dependencies:
- build-in3
script:
- sh /prepare.sh
- npm --no-git-tag-version --allow-same-version -f version $CI_COMMIT_TAG
- npm publish
deploy-to-slockit-public_npm:
stage: deploy
tags:
- short-jobs
only:
- /^v[0-9]+.[0-9]+.[0-9]+(\-RC[0-9]+)?$/
except:
- branches
dependencies:
- build-in3
script:
- sh /prepare.sh
- npm --no-git-tag-version --allow-same-version -f version $CI_COMMIT_TAG
- npm publish --registry https://registry.npmjs.org
deploy-docker:
stage: deploy
tags:
- short-jobs
services:
- docker:dind
image: docker.slock.it/build-images/deployment
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build -t $COMMIT_IMAGE_TAG .
- docker tag $COMMIT_IMAGE_TAG $RELEASE_IMAGE_TAG
- docker push $RELEASE_IMAGE_TAG
- docker push $COMMIT_IMAGE_TAG