Skip to content

Commit 9d966ab

Browse files
committed
CI: Get "latest" docker tag from git history
1 parent fc91cee commit 9d966ab

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.circleci/config.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ jobs:
149149
environment:
150150
TZ: "/usr/share/zoneinfo/America/Los_Angeles"
151151
steps:
152+
- checkout:
153+
path: /tmp/src/sdcflows
152154
- restore_cache:
153155
keys:
154156
- build-v2-{{ .Branch }}-{{ epoch }}
@@ -176,14 +178,14 @@ jobs:
176178
docker tag localhost:5000/sdcflows nipreps/sdcflows:latest
177179
docker tag localhost:5000/sdcflows nipreps/sdcflows
178180
else
179-
echo "Pulling from Docker Hub"
181+
LATEST=$( git describe --abbrev=0 )
182+
echo "Pulling nipreps/sdcflows:$LATEST from Docker Hub"
180183
docker pull ubuntu:xenial-20191010
181184
docker tag ubuntu:xenial-20191010 localhost:5000/ubuntu
182185
docker push localhost:5000/ubuntu
183-
docker pull nipreps/sdcflows:latest
186+
docker pull nipreps/sdcflows:$LATEST
187+
docker tag nipreps/sdcflows:$LATEST nipreps/sdcflows:latest
184188
fi
185-
- checkout:
186-
path: /tmp/src/sdcflows
187189
- run:
188190
name: Build Docker image
189191
no_output_timeout: 60m

0 commit comments

Comments
 (0)