Commit e87660cd authored by DasSkelett's avatar DasSkelett

Try explicit dependency on docker-build

parent f8de0aee
...@@ -57,6 +57,7 @@ docker-tests: ...@@ -57,6 +57,7 @@ docker-tests:
docker-publish: docker-publish:
stage: deploy stage: deploy
dependencies: dependencies:
- docker-build
- docker-tests - docker-tests
variables: variables:
FULL_VERSION: $FULL_VERSION FULL_VERSION: $FULL_VERSION
......
...@@ -14,17 +14,22 @@ if [[ -n $LAST_VERSION && $LAST_VERSION != $FULL_VERSION ]]; then ...@@ -14,17 +14,22 @@ if [[ -n $LAST_VERSION && $LAST_VERSION != $FULL_VERSION ]]; then
export CI_USE_CACHE=false export CI_USE_CACHE=false
fi fi
params=() params=()
if [[ $CI_USE_CACHE == true ]]; then
params+=(--cache-from "$CI_IMAGE_TAG")
else
params+=(--no-cache)
echo "CI_USE_CACHE is false"
fi
export params export params
# https://gitlab.com/gitlab-org/gitlab-foss/-/issues/17861#note_19140733 # https://gitlab.com/gitlab-org/gitlab-foss/-/issues/17861#note_19140733
if [[ $CI_USE_CACHE == true ]]; then if [[ $CI_USE_CACHE == true ]]; then
docker pull "$CI_IMAGE_TAG" || true if docker pull "$CI_IMAGE_TAG"; then
echo "Using existing image $CI_IMAGE_TAG as cache source"
params+=(--cache-from "$CI_IMAGE_TAG")
elif docker pull "$CI_REGISTRY_IMAGE:master"; then
echo "Falling back to $CI_REGISTRY_IMAGE:master as cache source"
params+=(--cache-from "$CI_REGISTRY_IMAGE:master")
else
echo "No available cache source found, building fresh"
params+=(--no-cache)
else
echo "CI_USE_CACHE is false"
params+=(--no-cache)
fi fi
docker build "${params[@]}" -t "${CI_IMAGE_TAG}" . docker build "${params[@]}" -t "${CI_IMAGE_TAG}" .
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment