@@ -32,43 +32,46 @@ docs_deploy: &docs
32
32
name : Deploy docs to gh-pages branch
33
33
command : gh-pages --dotfiles --message "doc(update) [skip ci]" --dist docs/_build/html
34
34
35
- version : 2
35
+ version : 2.1
36
+ orbs :
37
+ docker :
circleci/[email protected]
38
+
36
39
jobs :
37
40
cache_test_data :
38
41
docker :
39
- - image : python:3.7.4
42
+ - image : cimg/ python:3.9.16
40
43
working_directory : /tmp/data
41
44
environment :
42
45
- TEMPLATEFLOW_HOME : /tmp/templateflow
43
46
steps :
44
47
- restore_cache :
45
48
keys :
46
49
- env-v2-{{ .Branch }}-
47
- - env-v2-master -
50
+ - env-v2-maint/1.3.x -
48
51
- env-v2-
49
52
- restore_cache :
50
53
keys :
51
54
- data-v2-{{ .Branch }}-
52
- - data-v2-master -
55
+ - data-v2-maint/1.3.x -
53
56
- data-v2-
54
57
55
58
- run :
56
59
name : Setup git-annex
57
60
command : |
58
61
if [[ ! -d /usr/lib/git-annex.linux ]]; then
59
- wget -O- http://neuro.debian.net/lists/trusty .us-ca .full | tee /etc/apt/sources.list.d/neurodebian.sources.list
60
- apt-key adv --recv-keys --keyserver hkp ://pool.sks-keyservers.net:80 0xA5D32F012649A5A9
61
- apt update && apt-get install -y --no-install-recommends git-annex-standalone
62
+ wget -O- http://neuro.debian.net/lists/jammy .us-nh .full | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
63
+ sudo apt-key adv --recv-keys --keyserver hkps ://keyserver.ubuntu.com 0xA5D32F012649A5A9
64
+ sudo apt-get update && sudo apt-get install -y --no-install-recommends git-annex-standalone
62
65
fi
63
66
git config --global user.name 'NiPreps Bot'
64
67
git config --global user.email '[email protected] '
65
68
66
69
- run :
67
70
name : Setup DataLad & TemplateFlow
68
71
command : |
69
- python -m pip install --no-cache-dir -U pip
70
- python -m pip install --no-cache-dir -U datalad
71
- python -m pip install --no-cache-dir -U templateflow
72
+ pip install --no-cache-dir -U pip
73
+ pip install --no-cache-dir -U datalad
74
+ pip install --no-cache-dir -U templateflow
72
75
python -c "from templateflow import api as tfapi; \
73
76
tfapi.get('MNI152NLin2009cAsym', resolution=2, desc='brain', suffix='mask'); \
74
77
tfapi.get('MNI152NLin2009cAsym', resolution=2, desc='fMRIPrep', suffix='boldref');"
77
80
key : env-v2-{{ .Branch }}-{{ .BuildNum }}
78
81
paths :
79
82
- /tmp/cache/git-annex-standalone.tar.gz
80
- - /usr/local/bin
81
- - /usr/local/lib/python3.7/site-packages
82
83
- /usr/bin/git-annex
83
84
- /usr/bin/git-annex-shell
84
85
- /usr/lib/git-annex.linux
@@ -130,7 +131,8 @@ jobs:
130
131
--exclude='freesurfer/subjects/sample-*.mgz' \
131
132
--exclude='freesurfer/subjects/V1_average' \
132
133
--exclude='freesurfer/trctrain'
133
- echo "b2VzdGViYW5Ac3RhbmZvcmQuZWR1CjMwNzU2CiAqQ1MzYkJ5VXMxdTVNCiBGU2kvUGJsejJxR1V3Cg==" | base64 -d > /tmp/freesurfer/license.txt
134
+ pushd /tmp/freesurfer
135
+ echo "${FS_LICENSE_CONTENT}" | base64 -d | sh
134
136
else
135
137
echo "FreeSurfer was cached."
136
138
circleci step halt
@@ -142,17 +144,18 @@ jobs:
142
144
143
145
build_n_pytest :
144
146
machine :
145
- image : circleci/classic:201808-01
146
- working_directory : /tmp/tests
147
+ image : ubuntu-2204:2022.10.2
148
+ working_directory : /tmp/src/sdcflows
147
149
environment :
148
150
TZ : " /usr/share/zoneinfo/America/Los_Angeles"
149
151
steps :
152
+ - checkout :
153
+ path : /tmp/src/sdcflows
150
154
- restore_cache :
151
155
keys :
152
- - build-v2-{{ .Branch }}-{{ epoch }}
153
- - build-v2-{{ .Branch }}-
154
- - build-v2-master-
155
- - build-v2-
156
+ - build-v3-{{ .Branch }}-{{ epoch }}
157
+ - build-v3-{{ .Branch }}-
158
+ - build-v3-maint/1.3.x-
156
159
paths :
157
160
- /tmp/docker
158
161
- run :
@@ -174,24 +177,23 @@ jobs:
174
177
docker tag localhost:5000/sdcflows nipreps/sdcflows:latest
175
178
docker tag localhost:5000/sdcflows nipreps/sdcflows
176
179
else
177
- echo "Pulling from Docker Hub"
180
+ LATEST=$( git describe --abbrev=0 )
181
+ echo "Pulling nipreps/sdcflows:$LATEST from Docker Hub"
178
182
docker pull ubuntu:xenial-20191010
179
183
docker tag ubuntu:xenial-20191010 localhost:5000/ubuntu
180
184
docker push localhost:5000/ubuntu
181
- docker pull nipreps/sdcflows:latest
185
+ docker pull nipreps/sdcflows:$LATEST
186
+ docker tag nipreps/sdcflows:$LATEST nipreps/sdcflows:latest
182
187
fi
183
- - checkout :
184
- path : /tmp/src/sdcflows
185
188
- run :
186
189
name : Build Docker image
187
190
no_output_timeout : 60m
188
191
command : |
189
- cd /tmp/src/sdcflows
190
- pyenv local 3.7.0
191
- python3 -m pip install "setuptools ~= 42.0" "setuptools_scm[toml] >= 3.4" "pip>=10.0.1"
192
+ python3 -m pip install --upgrade pip
193
+ python3 -m pip install --upgrade "setuptools_scm[toml]"
192
194
193
195
# Get version, update files.
194
- THISVERSION=$( python3 setup.py --version )
196
+ THISVERSION=$( python3 -m setuptools_scm )
195
197
if [[ ${THISVERSION:0:1} == "0" ]] ; then
196
198
echo "WARNING: latest git tag could not be found"
197
199
echo "Please, make sure you fetch all tags from upstream with"
@@ -221,7 +223,7 @@ jobs:
221
223
docker exec -it registry /bin/registry garbage-collect --delete-untagged \
222
224
/etc/docker/registry/config.yml
223
225
- save_cache :
224
- key : build-v2 -{{ .Branch }}-{{ epoch }}
226
+ key : build-v3 -{{ .Branch }}-{{ epoch }}
225
227
paths :
226
228
- /tmp/docker
227
229
- run :
@@ -242,17 +244,16 @@ jobs:
242
244
- restore_cache :
243
245
keys :
244
246
- data-v2-{{ .Branch }}-
245
- - data-v2-master -
247
+ - data-v2-maint/1.3.x -
246
248
- data-v2-
247
249
- restore_cache :
248
250
keys :
249
251
- workdir-v2-{{ .Branch }}-
250
- - workdir-v2-master -
252
+ - workdir-v2-maint/1.3.x -
251
253
- workdir-v2-
252
254
- run :
253
255
name : Refreshing cached intermediate results
254
256
command : |
255
- cd /tmp/src/sdcflows
256
257
COMMIT_MSG=$( git log --format=oneline -n 1 $CIRCLE_SHA1 )
257
258
set +e
258
259
do_refresh="$( echo "${COMMIT_MSG}" | grep -i -E '\[refresh[ _]?cache\]' )"
@@ -298,7 +299,7 @@ jobs:
298
299
299
300
build_docs :
300
301
docker :
301
- - image : python:3.7.4
302
+ - image : cimg/ python:3.9.16
302
303
working_directory : /tmp/gh-pages
303
304
environment :
304
305
- FSLOUTPUTTYPE : NIFTI
@@ -310,18 +311,18 @@ jobs:
310
311
command : mkdir -p $SUBJECTS_DIR
311
312
- run :
312
313
name : Install Graphviz
313
- command : apt update && apt -y install graphviz
314
+ command : sudo apt-get update && sudo apt-get -y install --no-install-recommends graphviz
314
315
- run :
315
316
name : Install deps
316
317
command : |
317
318
pip install --no-cache-dir -r docs/requirements.txt
318
- pip install --no-cache-dir "setuptools ~= 42.0" " setuptools_scm[toml] >= 3.4 "
319
- python setup.py --version
319
+ pip install --no-cache-dir "setuptools_scm[toml]"
320
+ python -m setuptools_scm
320
321
- run :
321
322
name : Build only this commit
322
- command : make -C docs SPHINXOPTS="-W" BUILDDIR="_build/no_version_html" html
323
+ command : make -C docs SPHINXOPTS="-W" BUILDDIR="$HOME/docs" OUTDIR=no_version_html html
323
324
- store_artifacts :
324
- path : ./docs/_build/no_version_html/html
325
+ path : /home/circleci/docs/no_version_html
325
326
destination : noversion
326
327
- run :
327
328
name : Stop or generate versioned docs?
@@ -340,13 +341,15 @@ jobs:
340
341
keys :
341
342
- docs-v2-{{ .Branch }}-{{ .Revision }}
342
343
- docs-v2-{{ .Branch }}-
343
- - docs-v2-master
344
+ - docs-v2-maint/1.3.x
344
345
- docs-v2-
345
346
paths :
346
347
- ./docs/_build
347
348
- run :
348
349
name : Generate Versioned Docs
349
- command : make -f ./docs/Makefile versioned CURBRANCH=${CIRCLE_TAG:-$CIRCLE_BRANCH}
350
+ command : |
351
+ BRANCH=$( echo $CIRCLE_BRANCH | sed 's+/+_+g' )
352
+ make -C docs SPHINXOPTS="-W" BUILDDIR="$HOME/docs" OUTDIR=${CIRCLE_TAG:-$BRANCH} html
350
353
- save_cache :
351
354
key : docs-v2-{{ .Branch }}-{{ .Revision }}
352
355
paths :
@@ -360,15 +363,15 @@ jobs:
360
363
361
364
deploy_docker :
362
365
machine :
363
- image : circleci/classic:201711-01
366
+ image : ubuntu-2204:2022.10.2
364
367
working_directory : /tmp/src/
365
368
steps :
366
369
- restore_cache :
367
370
keys :
368
- - build-v2 -{{ .Branch }}-{{ epoch }}
369
- - build-v2 -{{ .Branch }}-
370
- - build-v2-master -
371
- - build-v2 -
371
+ - build-v3 -{{ .Branch }}-{{ epoch }}
372
+ - build-v3 -{{ .Branch }}-
373
+ - build-v3-maint/1.3.x -
374
+ - build-v3 -
372
375
paths :
373
376
- /tmp/docker
374
377
- run :
@@ -385,16 +388,15 @@ jobs:
385
388
name : Deploy to Docker Hub
386
389
no_output_timeout : 40m
387
390
command : |
388
- if [[ -n "$DOCKER_PASS" ]]; then
389
- docker login -u $DOCKER_USER -p $DOCKER_PASS
390
- docker push nipreps/sdcflows:latest
391
+ if [[ -n "$DOCKER_PAT" ]]; then
392
+ docker login -u $DOCKER_USER -p $DOCKER_PAT
391
393
docker tag nipreps/sdcflows nipreps/sdcflows:$CIRCLE_TAG
392
394
docker push nipreps/sdcflows:$CIRCLE_TAG
393
395
fi
394
396
395
397
test_package :
396
398
docker :
397
- - image : circleci /python:3.7.4
399
+ - image : cimg /python:3.9.16
398
400
working_directory : /tmp/src/sdcflows
399
401
steps :
400
402
- checkout
@@ -403,9 +405,8 @@ jobs:
403
405
command : |
404
406
python3 -m venv /tmp/buildenv
405
407
source /tmp/buildenv/bin/activate
406
- python3 -m pip install "setuptools ~= 42.0" wheel "setuptools_scm[toml] >= 3.4" \
407
- "pip>=10.0.1" twine docutils
408
- python setup.py sdist bdist_wheel
408
+ python3 -m pip install --upgrade pip build twine
409
+ python3 -m build
409
410
twine check dist/sdcflows*
410
411
- store_artifacts :
411
412
path : /tmp/src/sdcflows/dist
@@ -417,8 +418,8 @@ jobs:
417
418
command : |
418
419
python3 -m venv /tmp/install_sdist
419
420
source /tmp/install_sdist/bin/activate
420
- python3 -m pip install "setuptools ~= 42.0" " pip>=10.0.1"
421
- THISVERSION=$( python3 setup.py --version )
421
+ python3 -m pip install --upgrade pip setuptools_scm
422
+ THISVERSION=$( python3 -m setuptools_scm )
422
423
THISVERSION=${CIRCLE_TAG:-$THISVERSION}
423
424
python3 -m pip install dist/sdcflows*.tar.gz
424
425
INSTALLED_VERSION=$(python3 -c 'import sdcflows as sdc; print(sdc.__version__, end="")')
@@ -430,8 +431,8 @@ jobs:
430
431
command : |
431
432
python3 -m venv /tmp/install_wheel
432
433
source /tmp/install_wheel/bin/activate
433
- python3 -m pip install "setuptools ~= 42.0" " pip>=10.0.1"
434
- THISVERSION=$( python3 setup.py --version )
434
+ python3 -m pip install --upgrade pip setuptools_scm
435
+ THISVERSION=$( python3 -m setuptools_scm )
435
436
THISVERSION=${CIRCLE_TAG:-$THISVERSION}
436
437
python3 -m pip install dist/sdcflows*.whl
437
438
INSTALLED_VERSION=$(python3 -c 'import sdcflows as sdc; print(sdc.__version__, end="")')
@@ -441,7 +442,7 @@ jobs:
441
442
442
443
deploy_pypi :
443
444
docker :
444
- - image : circleci /python:3.7.4
445
+ - image : cimg /python:3.9.16
445
446
working_directory : /tmp/src/sdcflows
446
447
steps :
447
448
- attach_workspace :
@@ -458,14 +459,14 @@ jobs:
458
459
deploy_docs_tag :
459
460
<< : *docs
460
461
461
- deploy_docs_master :
462
- << : *docs
463
-
464
462
workflows :
465
463
version : 2
466
464
build_deploy :
467
465
jobs :
468
466
- cache_test_data :
467
+ context :
468
+ - nipreps-common
469
+ - fs-license
469
470
filters :
470
471
branches :
471
472
ignore :
@@ -484,6 +485,8 @@ workflows:
484
485
only : /.*/
485
486
486
487
- test_package :
488
+ context :
489
+ - nipreps-common
487
490
filters :
488
491
branches :
489
492
ignore :
@@ -493,6 +496,8 @@ workflows:
493
496
only : /.*/
494
497
495
498
- deploy_pypi :
499
+ context :
500
+ - nipreps-common
496
501
requires :
497
502
- build_docs
498
503
- test_package
@@ -504,6 +509,8 @@ workflows:
504
509
only : /.*/
505
510
506
511
- deploy_docker :
512
+ context :
513
+ - nipreps-common
507
514
requires :
508
515
- deploy_pypi
509
516
filters :
@@ -520,17 +527,6 @@ workflows:
520
527
tags :
521
528
only : /.*/
522
529
523
- - deploy_docs_master :
524
- requires :
525
- - build_n_pytest
526
- - test_package
527
- - build_docs
528
- filters :
529
- branches :
530
- only : /master/
531
- tags :
532
- ignore : /.*/
533
-
534
530
- deploy_docs_tag :
535
531
requires :
536
532
- deploy_docker
0 commit comments