11version : 2.1
22
33commands :
4- setup_steps :
4+ setup-executor :
5+ steps :
6+ - run :
7+ name : Setup executor
8+ command : |
9+ apt-get -qq update
10+ apt-get -q install -y git openssh-client curl ca-certificates make tar gzip
11+ bash <(curl -fsSL https://get.docker.com)
12+ - setup_remote_docker :
13+ docker_layer_caching : true
14+
15+ build-steps :
516 parameters :
617 platform :
718 type : string
819 steps :
920 - checkout
1021 - run :
1122 name : Submodule checkout
12- command : git submodule update --init --recursive
23+ command : git submodule update --init --recursive
1324 - restore_cache :
1425 keys :
1526 - v1-dependencies-{{ checksum "get_deps.sh" }}
@@ -19,69 +30,86 @@ commands:
1930 command : |
2031 ./opt/readies/bin/getpy3
2132 BREW_NO_UPDATE=1 ./opt/system-setup.py
22- # git clone git://github.com/antirez/redis.git --branch 6.0.1; (cd redis; make malloc=libc -j $(nproc); make install); redis-server --version
33+ # ./opt/readies/bin/getredis -v 6 --force
2334 ./get_deps.sh cpu
2435 - save_cache :
2536 paths :
2637 - deps
2738 key : build-dependencies-{{ checksum "get_deps.sh" }}
28- - run :
29- name : Set up workspace
30- command : |
31- mkdir -p ~/workspace
32- chown `whoami` ~/workspace
33-
34- test_steps :
35- parameters :
36- platform :
37- type : string
38- steps :
39- - checkout
40- - run :
41- name : Submodule checkout
42- command : git submodule update --init --recursive
4339 - run :
4440 name : Build
4541 command : make -C opt all SHOW=1
4642 - run :
4743 name : Test
4844 command : |
49- mkdir -p ~/workspace/tests
5045 make -C opt test SHOW=1
5146 no_output_timeout : 20m
5247 - run :
5348 name : Package
54- command : make -C opt pack BRANCH="${CIRCLE_BRANCH//[^A-Za-z0-9._-]/_}" INTO=~/workspace/packages SHOW=1
49+ command : make -C opt pack SHOW=1
5550 - persist_to_workspace :
56- root : ~/workspace
51+ root : bin/
5752 paths :
58- - ' packages/release/*.zip'
59- - ' packages/release/*.tgz'
60- - ' packages/branch/*.zip'
61- - ' packages/branch/*.tgz'
53+ - artifacts/*.zip
54+ - artifacts/*.tgz
6255 - store_artifacts :
6356 path : test/logs
6457
65- deploy :
58+ platform-build-steps :
59+ parameters :
60+ platform :
61+ type : string
62+ steps :
63+ - setup-executor
64+ - checkout
65+ - run :
66+ name : Setup
67+ command : |
68+ git submodule update --init --recursive
69+ ./opt/readies/bin/getpy3
70+ - run :
71+ name : Build for platform
72+ command : |
73+ docker login -u redisfab -p $DOCKER_REDISFAB_PWD
74+ cd opt/build/docker
75+ #@@ make build publish $(./version-params) CPU=1 OSNICK=<<parameters.platform>> X64=1 ARTIFACTS=1 TEST=1 VERBOSE=1
76+ make build publish $(./version-params) CPU=1 OSNICK=<<parameters.platform>> X64=1 ARTIFACTS=1 VERBOSE=1
77+ make build publish $(./version-params) GPU=1 OSNICK=<<parameters.platform>> X64=1 ARTIFACTS=1 VERBOSE=1
78+ no_output_timeout : 40m
79+ - persist_to_workspace :
80+ root : bin/
81+ paths :
82+ - artifacts/*.zip
83+ - artifacts/*.tgz
84+
85+ deploy-steps :
6686 parameters :
6787 from :
6888 type : string
6989 steps :
7090 - run :
7191 name : Deploy to S3
7292 command : |
73- aws s3 cp <<parameters.from>> / s3://redismodules/$PACKAGE_NAME/ --acl public-read --recursive --exclude "*" --include "*.zip" --include "*.tgz"
93+ aws s3 cp artifacts / s3://redismodules/$PACKAGE_NAME/ --acl public-read --recursive --exclude "*" --include "*.zip" --include "*.tgz"
7494
7595jobs :
76- build :
96+ build-debian :
7797 docker :
7898 - image : redisfab/rmbuilder:6.0.1-x64-buster
7999 steps :
80- - setup_steps :
81- platform : debian
82- - test_steps :
100+ - build-steps :
83101 platform : debian
84102
103+ platform-build :
104+ parameters :
105+ platform :
106+ type : string
107+ docker :
108+ - image : debian:buster
109+ steps :
110+ - platform-build-steps :
111+ platform : <<parameters.platform>>
112+
85113 coverage :
86114 docker :
87115 - image : redisfab/rmbuilder:6.0.1-x64-buster
@@ -99,13 +127,8 @@ jobs:
99127 command : |
100128 ./opt/readies/bin/getpy3
101129 ./opt/system-setup.py
102- # git clone git://github.com/antirez/redis.git --branch 6.0.1; cd redis; make malloc=libc -j $(nproc); make install; redis-server --version
130+ # ./opt/readies/bin/getredis -v 6 --force
103131 ./get_deps.sh cpu
104- - run :
105- name : Set up workspace
106- command : |
107- mkdir -p ~/workspace
108- chown `whoami` ~/workspace
109132 - run :
110133 name : Build for coverage
111134 command : |
@@ -119,21 +142,19 @@ jobs:
119142
120143 build-macos :
121144 macos :
122- xcode : 11.1 .0
145+ xcode : 11.3 .0
123146 steps :
124147 - run :
125148 name : Fix macOS Python installation
126149 command : |
127150 brew reinstall -f python2
128- - setup_steps :
129- platform : macosx
130- - test_steps :
151+ - build-steps :
131152 platform : macosx
132153
133154 build-multiarch-docker :
134155 machine :
135156 enabled : true
136- image : ubuntu-1604:201903- 01
157+ image : cimg/base:2020. 01
137158 steps :
138159 - checkout
139160 - run :
@@ -155,10 +176,11 @@ jobs:
155176 name : Build
156177 command : |
157178 sudo docker login -u redisfab -p $DOCKER_REDISFAB_PWD
158- make -C opt/build/docker build
159- sudo make -C opt/build/docker publish
179+ cd opt/build/docker
180+ make build
181+ sudo make publish
160182
161- build-gpu :
183+ build-and-test- gpu :
162184 machine :
163185 enabled : true
164186 docker_layer_caching : true
@@ -176,82 +198,120 @@ jobs:
176198 - run :
177199 name : Test
178200 command : |
179- mkdir -p ~/workspace /tests
180- docker run --gpus all -v $HOME/workspace/ tests:/build/test/logs -it --rm redisai-gpu:latest-x64-bionic-test
201+ mkdir -p $HOME /tests
202+ docker run --gpus all -v $HOME/tests:/build/test/logs -it --rm redisai-gpu:latest-x64-bionic-test
181203 no_output_timeout : 30m
182204 - store_artifacts :
183- path : ~/workspace/ tests
205+ path : tests
184206
185- deploy_package :
207+ deploy-artifacts :
186208 parameters :
187209 package :
188210 type : string
189211 docker :
190212 - image : redisfab/rmbuilder:6.0.1-x64-buster
191213 steps :
192214 - attach_workspace :
193- at : ~/workspace
194- - deploy :
195- from : ~/workspace/packages/<<parameters.package>>
196- - store_artifacts :
197- path : ~/workspace/packages/<<parameters.package>>
215+ at : workspace
216+ - run :
217+ name : Deploy to S3
218+ command : |
219+ cd workspace
220+ aws s3 cp artifacts/ s3://redismodules/$PACKAGE_NAME/ --acl public-read --recursive --exclude "*" --include "*.zip" --include "*.tgz"
221+
222+
223+ on-any-branch : &on-any-branch
224+ filters :
225+ branches :
226+ only : /.*/
227+ tags :
228+ only : /.*/
229+
230+ never : &never
231+ filters :
232+ branches :
233+ ignore : /.*/
234+ tags :
235+ ignore : /.*/
236+
237+ on-master : &on-master
238+ filters :
239+ branches :
240+ only : master
241+
242+ on-version-tags : &on-version-tags
243+ filters :
244+ branches :
245+ ignore : /.*/
246+ tags :
247+ only : /^v[0-9].*/
248+
249+ on-master-and-version-tags : &on-master-and-version-tags
250+ filters :
251+ branches :
252+ only :
253+ - master
254+ tags :
255+ only : /^v[0-9].*/
256+
257+
258+ platform-build-defs : &platform-build-defs
259+ requires :
260+ - build-debian
261+ # @@ <<: *on-master-and-version-tags
262+ << : *on-any-branch
263+
264+ after-platform-builds : &after-platform-builds
265+ requires :
266+ - build-centos7
267+ - build-bionic
268+ - build-xenial
269+
198270
199271workflows :
200272 version : 2
201273 build_and_package :
202274 jobs :
203- - build :
204- filters :
205- tags :
206- only : /.*/
275+ - build-debian :
276+ << : *on-any-branch
277+ - platform-build :
278+ name : build-centos7
279+ platform : centos7
280+ << : *platform-build-defs
281+ - platform-build :
282+ name : build-bionic
283+ platform : bionic
284+ << : *platform-build-defs
285+ - platform-build :
286+ name : build-xenial
287+ platform : xenial
288+ << : *platform-build-defs
207289 - coverage :
208- filters :
209- branches :
210- only : /.*/
211- tags :
212- only : /.*/
213- # - build-macos:
214- # filters:
215- # branches:
216- # ignore: /.*/
217- # tags:
218- # only: /^v[0-9].*/
219- # - build-multiarch-docker:
220- # filters:
221- # tags:
222- # only: /^v[0-9].*/
223- # branches:
224- # ignore: /.*/
225- - build-gpu :
226- filters :
227- tags :
228- only : /.*/
229- - deploy_package :
230- name : deploy_branch
290+ << : *on-any-branch
291+ - build-and-test-gpu :
292+ << : *on-any-branch
293+ - build-macos :
294+ << : *never
295+ # <<: *on-version-tags
296+ - build-multiarch-docker :
297+ << : *never
298+ # <<: *on-version-tags
299+ - deploy-artifacts :
300+ name : deploy-branch
231301 package : branch
232- requires :
233- - build
234- filters :
235- branches :
236- only : master
237- - deploy_package :
238- name : deploy_release
302+ << : *after-platform-builds
303+ << : *on-any-branch
304+ - deploy-artifacts :
305+ name : deploy-release
239306 package : release
240- requires :
241- - build
242- filters :
243- branches :
244- ignore : /.*/
245- tags :
246- only : ' /^v[0-9].*/'
307+ << : *after-platform-builds
308+ << : *on-version-tags
247309
248- # nightly:
249- # triggers:
250- # - schedule:
251- # cron: "20 17 * * *"
252- # filters:
253- # branches:
254- # only:
255- # - master
256- # jobs:
257- # - build-macos
310+ nightly :
311+ triggers :
312+ - schedule :
313+ cron : " 20 17 * * *"
314+ << : *on-master
315+ jobs :
316+ - build-macos :
317+ << : *never
0 commit comments