-
Notifications
You must be signed in to change notification settings - Fork 6
/
.gitlab-ci.yml
273 lines (260 loc) · 8.55 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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
stages:
- build
- build2
- test
- deploy
- docker-prepare
- docker-deploy
# The docker-prepare is intended to build base docker image
# this image contains required packages to be able to run platincoind
# It should be triggered if required changes of any base packages or distro
# See docker/plc-coin_base.Dockerfile
job-debian-docker-prepare:
stage: docker-prepare
when: manual
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/docker/plc-coin_base.Dockerfile --destination $CI_REGISTRY/plc-blockchain/debian-9-platincoin-base:$CI_COMMIT_TAG
tags:
- kaniko
job-debian-build:
stage: build
before_script:
- echo `find /tmp/test* -mtime +2 | xargs rm -rf`
- rm -rf configure
script:
- ./autogen.sh
- ./configure --enable-static --disable-shared --with-incompatible-bdb
- make -j 2
- mkdir -p build/debian
- make install-strip DESTDIR=$PWD/build/debian
cache:
key: "debian-build-$CI_PIPELINE_ID"
untracked: true
tags:
- debian
artifacts:
paths:
- build/debian/usr/local/bin/
job-win64-build:
stage: build2
script:
- rm -rf configure
- cd depends
- make HOST=x86_64-w64-mingw32 SOURCES_PATH=$HOME/Downloads BASE_CACHE=$HOME/Cache -j 2
- cd ..
- ./autogen.sh
- CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --disable-tests --prefix=/ --enable-static --disable-shared
- make -j 2
- mkdir -p build/win64
- make install DESTDIR=$PWD/build/win64
dependencies:
- job-debian-build
tags:
- windows-w64
artifacts:
paths:
- build/win64/bin/
only:
- master
- stable
- tags
allow_failure: true
job-win32-build:
stage: build2
script:
- rm -rf configure
- cd depends
- make HOST=i686-w64-mingw32 SOURCES_PATH=$HOME/Downloads BASE_CACHE=$HOME/Cache -j 2
- cd ..
- ./autogen.sh
- CONFIG_SITE=$PWD/depends/i686-w64-mingw32/share/config.site ./configure --disable-tests --prefix=/ --enable-static --disable-shared
- make -j 2
- mkdir -p build/win32
- make install DESTDIR=$PWD/build/win32
dependencies:
- job-debian-build
tags:
- windows-w32
artifacts:
paths:
- build/win32/bin/
only:
- master
- stable
- tags
allow_failure: true
job-macos-build:
stage: build2
script:
- rm -rf $HOME/Cache/x86_64-apple-darwin11/qt
- rm -rf configure
- cd depends
- make HOST=x86_64-apple-darwin11 SOURCES_PATH=$HOME/Downloads BASE_CACHE=$HOME/Cache SDK_PATH=$HOME/Import/MacOSX-SDKs -j 2
- cd ..
- ./autogen.sh
- CONFIG_SITE=$PWD/depends/x86_64-apple-darwin11/share/config.site ./configure --disable-tests --prefix=/ --enable-static --disable-shared
- make -j 2
- make appbundle
- mkdir -p build/macos
- mv Platincoin-Qt.app build/macos/
dependencies:
- job-debian-build
tags:
- macos
artifacts:
paths:
- build/macos/
only:
- master
- stable
- tags
allow_failure: true
job-linux-arm32-build:
stage: build2
script:
- rm -rf configure
- cd depends
- make HOST=arm-linux-gnueabihf SOURCES_PATH=$HOME/Downloads BASE_CACHE=$HOME/Cache -j 2
- cd ..
- ./autogen.sh
- CONFIG_SITE=$PWD/depends/arm-linux-gnueabihf/share/config.site ./configure --disable-tests --prefix=/ --enable-static --disable-shared --enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++
- make -j 2
- mkdir -p build/arm32
- make install DESTDIR=$PWD/build/arm32
dependencies:
- job-debian-build
tags:
- linux-arm32
artifacts:
paths:
- build/arm32/
only:
- master
- stable
- tags
allow_failure: true
job-linux-arm64-build:
stage: build2
script:
- rm -rf configure
- cd depends
- make HOST=aarch64-linux-gnu SOURCES_PATH=$HOME/Downloads BASE_CACHE=$HOME/Cache -j 2
- cd ..
- ./autogen.sh
- CONFIG_SITE=$PWD/depends/aarch64-linux-gnu/share/config.site ./configure --enable-static --disable-shared --disable-tests --prefix=/ --enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++
- make -j 2
- mkdir -p build/arm64
- make install DESTDIR=$PWD/build/arm64
dependencies:
- job-debian-build
tags:
- linux-arm64
artifacts:
paths:
- build/arm64/
only:
- master
- stable
- tags
allow_failure: true
job-debian-test:
stage: test
script:
- make check VERBOSE=1
dependencies:
- job-debian-build
cache:
key: "debian-build-$CI_PIPELINE_ID"
untracked: true
tags:
- debian
job-extended-test:
stage: test
when: manual
script:
- $PWD/qa/pull-tester/rpc-tests.py -extended
after_script:
- echo `ps aux | grep $PWD | grep python3 | awk '{print $2}' | xargs -l -r kill -9`
- echo `ps aux | grep platincoind | grep 'datadir=/tmp/test' | awk '{print $2}' | xargs -l -r kill -9`
- sleep 10
- mkdir -p qa/cache
- echo `find /tmp/test* -maxdepth 0 -print | tar -czf qa/cache/failed-tests.tar.gz --files-from - --remove-files`
dependencies:
- job-debian-build
cache:
key: "debian-build-$CI_PIPELINE_ID"
untracked: true
tags:
- debian
artifacts:
when: on_failure
paths:
- qa/cache/failed-tests.tar.gz
allow_failure: true
job-extended-test-kill-and-clean:
stage: test
when: manual
script:
- echo $PWD
- echo `ps aux | grep $PWD | grep python3 | awk '{print $2}' | xargs -l -r kill -9`
- echo `ps aux | grep platincoind | grep 'datadir=/tmp/test' | awk '{print $2}' | xargs -l -r kill -9`
- sleep 10
- mkdir -p qa/cache
- echo `find /tmp/test* -maxdepth 0 -print | tar -czf qa/cache/failed-tests.tar.gz --files-from - --remove-files`
dependencies:
- job-debian-build
tags:
- debian
artifacts:
paths:
- qa/cache/failed-tests.tar.gz
job-staging-deploy:
stage: deploy
script:
- mkdir -p /var/www/html/packages/staging/$CI_PROJECT_NAME
- zip -P $ZIP_PASSWORD -r /var/www/html/packages/staging/$CI_PROJECT_NAME/$CI_PROJECT_NAME-$CI_COMMIT_REF_SLUG-$CI_PIPELINE_ID.zip build/*
- ln -s -f /var/www/html/packages/staging/$CI_PROJECT_NAME/$CI_PROJECT_NAME-$CI_COMMIT_REF_SLUG-$CI_PIPELINE_ID.zip /var/www/html/packages/staging/$CI_PROJECT_NAME/$CI_PROJECT_NAME-$CI_COMMIT_REF_SLUG-latest.zip
tags:
- debian
only:
- master
- stable
except:
- tags
job-release-deploy:
stage: deploy
script:
- mkdir -p /var/www/html/packages/releases/$CI_PROJECT_NAME
- zip -r /var/www/html/packages/releases/$CI_PROJECT_NAME/$CI_PROJECT_NAME-debian-x64-$CI_COMMIT_REF_SLUG-$CI_PIPELINE_ID.zip build/debian/*
- zip -r /var/www/html/packages/releases/$CI_PROJECT_NAME/$CI_PROJECT_NAME-macos-$CI_COMMIT_REF_SLUG-$CI_PIPELINE_ID.zip build/macos/* || true
- zip -r /var/www/html/packages/releases/$CI_PROJECT_NAME/$CI_PROJECT_NAME-win32-$CI_COMMIT_REF_SLUG-$CI_PIPELINE_ID.zip build/win32/* || true
- zip -r /var/www/html/packages/releases/$CI_PROJECT_NAME/$CI_PROJECT_NAME-win64-$CI_COMMIT_REF_SLUG-$CI_PIPELINE_ID.zip build/win64/* || true
- zip -r /var/www/html/packages/releases/$CI_PROJECT_NAME/$CI_PROJECT_NAME-arm32-$CI_COMMIT_REF_SLUG-$CI_PIPELINE_ID.zip build/arm32/* || true
- zip -r /var/www/html/packages/releases/$CI_PROJECT_NAME/$CI_PROJECT_NAME-arm64-$CI_COMMIT_REF_SLUG-$CI_PIPELINE_ID.zip build/arm64/* || true
- mkdir -p build/debian/DEBIAN
- cp debian/control build/debian/DEBIAN/
- 'sed -i "10cVersion: $CI_COMMIT_REF_SLUG-$CI_PIPELINE_ID" build/debian/DEBIAN/control'
- fakeroot dpkg-deb --build build/debian build/$CI_PROJECT_NAME-debian-x64-$CI_COMMIT_REF_SLUG-$CI_PIPELINE_ID.deb
- cp build/$CI_PROJECT_NAME-debian-x64-$CI_COMMIT_REF_SLUG-$CI_PIPELINE_ID.deb /var/www/html/packages/releases/$CI_PROJECT_NAME/
tags:
- debian
only:
- tags
job-debian-docker-deploy:
stage: docker-deploy
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --build-arg=PLATINCOIN_VERSION=$CI_COMMIT_TAG --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/docker/plc-coin.Dockerfile --destination $CI_REGISTRY/plc-blockchain/debian-9-platincoin:$CI_COMMIT_REF_SLUG-$CI_PIPELINE_ID
dependencies:
- job-debian-build
tags:
- kaniko
only:
- tags