Skip to content
Snippets Groups Projects
Commit 4f220608 authored by q3k's avatar q3k Committed by rahix
Browse files

fix(ci): Use pre-built docker images

In this change we modify the CI pipeline to use pre-built Docker images
for both build and deploy stages.  To this end, we create
`docker/{build-env,deploy-env}`, two directories containing Dockerfiles
describing how to build those images, and scripts to push them to a
Docker registry.

Currently, docker.card10.badge.events.ccc.de seems broken. Thus, we push
to the Warsaw Hackerspace Docker registry.  Since the Docker images will
be pulled rarely anyway (as they are cached by build nodes), any low
bandwidth-caused slowdowns will not be usually end up in the CI critical
path.

We also bump `.gitlab-ci.yml` to point to those new images.
parent f54e3c0e
No related branches found
No related tags found
No related merge requests found
image: "debian"
# maintained by q3k, built using docker/build-env
image: "registry.k0.hswaw.net/q3k/card10-build-env:20190725-110707Z-4f3bf2a"
build:
stage: build
before_script:
- echo "deb http://deb.debian.org/debian stretch-backports main" >> /etc/apt/sources.list
- apt update -qq
- apt install -y -qq gcc-arm-none-eabi python3-pip git
- apt install -y -qq -t stretch-backports meson
- pip3 install crc16
script:
- ./bootstrap.sh
- ninja -C build/
......@@ -15,11 +10,8 @@ build:
pages:
stage: deploy
image: ubuntu:bionic
before_script:
- apt update -qq
- apt install -y -qq python3-pip git clang libclang-dev llvm
- pip3 install sphinx sphinx_rtd_theme clang
# maintaned by q3k, build using docker/deploy-env
image: "registry.k0.hswaw.net/q3k/card10-deploy-env:20190725-112709Z-4c5d8e8"
script:
- export LD_LIBRARY_PATH=$(llvm-config --libdir)
- echo $LD_LIBRARY_PATH
......
FROM debian:stretch-backports
RUN set -e -x ;\
export DEBIAN_FRONTEND=noninteractive ;\
apt-get update -y ;\
apt-get install -y \
git \
gcc-arm-none-eabi \
python3-pip ;\
apt-get install -y -t stretch-backports \
meson ;\
pip3 install crc16 ;\
rm -rf /var/lib/apt/lists
#!/usr/bin/env bash
# Build and push the build env Docker container to the Gitlab container registry.
set -e
function rev() {
( cd $1; git describe --always --match "v[0-9].*" --dirty )
}
IMAGE=registry.k0.hswaw.net/q3k/card10-build-env
TAG=$(TZ=UTC date +%Y%m%d-%H%M%SZ)-$(rev .)
docker build -t $IMAGE:$TAG .
docker push $IMAGE:$TAG
echo "Pushed $IMAGE:$TAG"
FROM ubuntu:bionic
RUN set -e -x ;\
export DEBIAN_FRONTEND=noninteractive ;\
apt-get update -y ;\
apt-get install -y \
clang \
git \
libclang-dev \
llvm \
python3-pip ;\
pip3 install \
clang \
sphinx \
sphinx_rtd_theme ;\
rm -rf /var/lib/apt/lists
#!/usr/bin/env bash
# Build and push the deploy env Docker container to the Gitlab container registry.
set -e
function rev() {
( cd $1; git describe --always --match "v[0-9].*" --dirty )
}
IMAGE=registry.k0.hswaw.net/q3k/card10-deploy-env
TAG=$(TZ=UTC date +%Y%m%d-%H%M%SZ)-$(rev .)
docker build -t $IMAGE:$TAG .
docker push $IMAGE:$TAG
echo "Pushed $IMAGE:$TAG"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment