Skip to content

Commit a2a96bb

Browse files
authored
CI: Improve tag detection for docker builds (#3066)
Since moving to hatch-vcs and the next version strategies of `setuptools_scm`, the default behavior of a new branch is to increment the minor version (or major, if the new year happens to have come). At the same time, we have rules where `docker/XYZ` produces a docker tag `nipreps/fmriprep:XYZ`. To create a Docker branch that indicates a patch on a minor series, which will be useful for reusing work directories and testing patches before a bug-fix release, this change allows for branches named `docker/X.Y.x+tag`. For example, `docker/23.1.x+mynewpatch` would produce a version `23.1.5.devN+gHASH` and a Docker image `nipreps/fmriprep:mynewpatch`.
1 parent 0998c5f commit a2a96bb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.circleci/config.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -854,8 +854,10 @@ jobs:
854854
name: Deploy to Docker Hub
855855
no_output_timeout: 40m
856856
command: |
857-
docker tag nipreps/fmriprep nipreps/fmriprep:${CIRCLE_BRANCH#docker/}
858-
docker push nipreps/fmriprep:${CIRCLE_BRANCH#docker/}
857+
# Format: docker/[<version-like>+]<tag> -> nipreps/fmriprep:<tag>
858+
# <version-like>+<tag> guides setuptools_scm to get the right major/minor
859+
docker tag nipreps/fmriprep nipreps/fmriprep:${CIRCLE_BRANCH##*[/+]}
860+
docker push nipreps/fmriprep:${CIRCLE_BRANCH##*[/+]}
859861
860862
deploy_docker:
861863
<<: *machine_defaults

0 commit comments

Comments
 (0)