Skip to content

Commit f7007ad

Browse files
committed
CI: Use retry_cmd.sh to retry Docker commands
1 parent aa994d5 commit f7007ad

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

.circleci/config.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ _get_base_image: &get_base_image
3636
echo "Pulling base image ..."
3737
docker pull nipype/nipype:base
3838
elif [ "$GET_BASE" == "BUILD" ]; then
39-
e=1 && for i in {1..5}; do
40-
docker build -t nipype/nipype:base - < docker/Dockerfile.base && e=0 && break || sleep 15
41-
done && [ "$e" -eq "0" ]
39+
tools/retry_cmd.sh -n 5 -s 15 \
40+
docker build -t nipype/nipype:base - < docker/Dockerfile.base
4241
else
4342
echo "Error: method to get base image not understood"
4443
exit 1
@@ -48,22 +47,20 @@ _build_main_image_py36: &build_main_image_py36
4847
name: Build main image (py36)
4948
no_output_timeout: 60m
5049
command: |
51-
e=1 && for i in {1..5}; do
50+
tools/retry_cmd.sh -n 5 -s 15 \
5251
docker build \
5352
--rm=false \
5453
--tag nipype/nipype:latest \
5554
--tag nipype/nipype:py36 \
5655
--build-arg BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \
5756
--build-arg VCS_REF="$(git rev-parse --short HEAD)" \
5857
--build-arg VERSION="${CIRCLE_TAG}" /home/circleci/nipype \
59-
&& e=0 && break || sleep 15
60-
done && [ "$e" -eq "0" ]
6158
6259
_build_main_image_py27: &build_main_image_py27
6360
name: Build main image (py27)
6461
no_output_timeout: 60m
6562
command: |
66-
e=1 && for i in {1..5}; do
63+
tools/retry_cmd.sh -n 5 -s 15 \
6764
docker build \
6865
--rm=false \
6966
--tag nipype/nipype:py27 \
@@ -72,8 +69,6 @@ _build_main_image_py27: &build_main_image_py27
7269
--build-arg BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \
7370
--build-arg VCS_REF="$(git rev-parse --short HEAD)" \
7471
--build-arg VERSION="${CIRCLE_TAG}-py27" /home/circleci/nipype \
75-
&& e=0 && break || sleep 15
76-
done && [ "$e" -eq "0" ]
7772
7873
_download_test_data: &_download_test_data
7974
name: Download test data

0 commit comments

Comments
 (0)