Skip to content

Commit dd92375

Browse files
committed
Add auto-retry for builds when project download fails
1 parent eb79faf commit dd92375

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

.gitlab/ci/container-build.gitlab-ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
- docker_login
99
- 'image=$(echo "$CI_JOB_NAME" | cut -d : -f 2)'
1010
- '[ -z "$NEED_PROJECT_DOWNLOAD" ] || download_project $image'
11+
retry:
12+
exit_codes:
13+
- 10 # when downloading project fails
1114

1215
.single-image-build-base:
1316
extends:

scripts/helpers.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ function download_project() {
33
version=$(cat versions/$project)
44
echo "Downloading $project at $version"
55
mkdir -p projects
6-
curl --output projects/$project.tar.gz -L "https://github.com/code0-tech/$project/archive/$version.tar.gz" || return 1
7-
tar -xzf projects/$project.tar.gz -C projects || return 1
6+
curl --output projects/$project.tar.gz -L "https://github.com/code0-tech/$project/archive/$version.tar.gz" || return 10
7+
tar -xzf projects/$project.tar.gz -C projects || return 10
88
rm projects/$project.tar.gz || return 1
99
mv projects/$project-* projects/$project || return 1
1010
}

0 commit comments

Comments
 (0)