Read about our upcoming Code of Conduct on this issue

Commit 6232a201 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

Initial image for released Mercurial version

We're doing a too common dance: reinstalling build-deps to install
Mercurial and removing them at the end.
parent 6c4edcc27c39
stages:
- build
docker:
stage: build
rules:
- when: manual
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- ./kaniko.sh
#!/busybox/sh
set -e
mkdir -p /kaniko/.docker
echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
if [ "$CI_COMMIT_HG_BRANCH" = "stable" ]; then
PYDEPS_TAG="stable"
else
PYDEPS_TAG="latest"
fi
if [ "$CI_COMMIT_BRANCH" = "branch/default" ]; then
TAG="latest"
elif [ "$CI_COMMIT_HG_BRANCH" = "branch/stable" ]; then
TAG="stable"
else
TAG="$CI_COMMIT_HG_SHORT_SHA"
fi
set -u
set -x
# TODO add separate loop for hg-default and hg-stable
DESTINATION=${CI_REGISTRY_IMAGE}/hg-current:${TAG}
echo "Building with kaniko, pushing to ${DESTINATION}"
cp $CI_PROJECT_DIR/requirements.txt $CI_PROJECT_DIR/released-hg/
# TODO put released hg version to use in a separate file for better clarity
/kaniko/executor --context $CI_PROJECT_DIR/released-hg \
--dockerfile $CI_PROJECT_DIR/released-hg/Dockerfile \
--build-arg HG_VERSION=5.5.2 \
--build-arg PYDEPS_TAG=${PYDEPS_TAG} \
--destination $DESTINATION
ARG PYDEPS_TAG
FROM registry.heptapod.net:443/heptapod/ci-images/fixed-pydeps:${PYDEPS_TAG}
ARG HG_VERSION
COPY requirements.txt /root/requirements.txt
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
python3-dev \
&& \
pip3 install Mercurial==${HG_VERSION} hg-evolve && \
pip3 install -r /root/requirements.txt && \
apt-get remove -y build-essential python3-dev && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean
# additional requirements excluding Mercurial and hg-evolve, which can be rolling
hg-loggingmod
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