Read about our upcoming Code of Conduct on this issue

Commit 6b30d15f authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

Splitting kaniko job in three different ones

Building several images in one single run is not exactly
what Kaniko is designed to do (subsequent install done on top
of the first).

Even if it seems ok up to now in our case, each time there's trouble
with these images, the possibility that it could be due to some
side effect here makes me lose precious time.
parent 801a86994ccc
Pipeline #27076 failed with stages
in 1 minute and 41 seconds
......@@ -2,7 +2,7 @@ stages:
- build
- downstream
docker:
.docker:
stage: build
rules:
- if: '$CI_COMMIT_BRANCH =~ /^branch\/.*/' # named branch (not a topic)
......@@ -15,7 +15,25 @@ docker:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- ./kaniko.sh
- ./kaniko.sh $CI_HG_VERSION
hg-stable:
extends:
- .docker
variables:
HG_VERSION: stable
hg-default:
extends:
- .docker
variables:
HG_VERSION: default
hg-current:
extends:
- .docker
variables:
HG_VERSION: current
.downstreams:
rules:
......
......@@ -44,26 +44,38 @@ fi
set -u
set -x
for HG_BRANCH in default stable; do
DESTINATION=${CI_REGISTRY_IMAGE}/hg-${HG_BRANCH}:${TAG}
if [ "$HG_VERSION" = "stable" ]; then
DESTINATION=${CI_REGISTRY_IMAGE}/hg-${HG_VERSION}:${TAG}
echo "Building with kaniko, pushing to ${DESTINATION}"
/kaniko/executor --context $CI_PROJECT_DIR/context \
--dockerfile $CI_PROJECT_DIR/Dockerfile.rolling-hg \
--build-arg HG_BRANCH=${HG_BRANCH} \
--build-arg HG_BRANCH=${HG_VERSION} \
--build-arg PYDEPS_TAG=${PYDEPS_TAG} \
--single-snapshot \
--cleanup \
--destination $DESTINATION
done
elif [ "$HG_VERSION" = "default" ]; then
DESTINATION=${CI_REGISTRY_IMAGE}/hg-${HG_VERSION}:${TAG}
echo "Building with kaniko, pushing to ${DESTINATION}"
DESTINATION=${CI_REGISTRY_IMAGE}/hg-current:${TAG}
echo "Building with kaniko, pushing to ${DESTINATION}"
/kaniko/executor --context $CI_PROJECT_DIR/context \
--dockerfile $CI_PROJECT_DIR/Dockerfile.rolling-hg \
--build-arg HG_BRANCH=${HG_VERSION} \
--build-arg PYDEPS_TAG=${PYDEPS_TAG} \
--single-snapshot \
--cleanup \
--destination $DESTINATION
elif [ "$HG_VERSION" = "current" ]; then
# TODO put released hg version to use in a separate file for better clarity
/kaniko/executor --context $CI_PROJECT_DIR/context \
--dockerfile $CI_PROJECT_DIR/Dockerfile.released-hg \
--build-arg HG_VERSION=5.7.1 \
--reproducible \
--build-arg PYDEPS_TAG=${PYDEPS_TAG} \
--destination $DESTINATION
DESTINATION=${CI_REGISTRY_IMAGE}/hg-current:${TAG}
echo "Building with kaniko, pushing to ${DESTINATION}"
# TODO put released hg version to use in a separate file for better clarity
/kaniko/executor --context $CI_PROJECT_DIR/context \
--dockerfile $CI_PROJECT_DIR/Dockerfile.released-hg \
--build-arg HG_VERSION=5.7.1 \
--reproducible \
--build-arg PYDEPS_TAG=${PYDEPS_TAG} \
--destination $DESTINATION
fi
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