Commit 74f1d9a2 authored by Guillaume Melquiond's avatar Guillaume Melquiond

Create only long-lived docker images and prune dangling ones after deployment.

parent e96acabd
......@@ -6,9 +6,7 @@ stages:
.build_template: &build_definition
stage: build
script:
- autoconf && (automake --add-missing 2> /dev/null || true)
- docker build -t bench-image-$COMPILER -f misc/Dockerfile.init --build-arg compiler=$COMPILER .
- docker run -t --rm bench-image-$COMPILER misc/ci-local.sh
- misc/ci-docker.sh misc/ci-local.sh
build:
variables:
......@@ -40,16 +38,12 @@ bench:
variables:
COMPILER: system
script:
- autoconf && (automake --add-missing 2> /dev/null || true)
- docker build -t bench-image-$COMPILER -f misc/Dockerfile.init --build-arg compiler=$COMPILER .
- docker run -t --rm bench-image-$COMPILER misc/ci-local.sh bench
- misc/ci-docker.sh misc/ci-local.sh bench
.bench_template: &bench_definition
stage: test
script:
- autoconf && (automake --add-missing 2> /dev/null || true)
- docker build -t bench-image-$COMPILER -f misc/Dockerfile.init --build-arg compiler=$COMPILER .
- docker run -t --rm bench-image-$COMPILER misc/ci-local.sh bench
- misc/ci-docker.sh misc/ci-local.sh bench
only:
- tags
- schedules
......@@ -76,11 +70,10 @@ bench-4.06.0:
opam:
stage: build
variables:
COMPILER: system
script:
- autoconf && (automake --add-missing 2> /dev/null || true)
- docker build -t bench-image -f misc/Dockerfile.init .
- docker build -t opam-image -f misc/Dockerfile.opam .
- docker run -t --rm opam-image opam pin -v -y add why3-ide .
- misc/ci-docker.sh misc/ci-opam.sh
deploy:
stage: deploy
......@@ -91,5 +84,6 @@ deploy:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker tag deploy-image $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
- docker image prune
only:
- master
FROM bench-image
USER root
RUN adduser --disabled-password --gecos '' guest
USER why3
COPY --chown=why3:why3 . why3
WORKDIR /home/why3/why3
RUN eval `opam config env` && \
./configure && \
make -j2
......@@ -7,10 +16,9 @@ RUN eval `opam config env` && \
USER root
RUN make install
RUN sudo adduser --disabled-password --gecos '' guest
USER guest
ENV HOME /home/guest
WORKDIR /home/guest
RUN why3 config --detect
......@@ -16,8 +16,3 @@ RUN opam install -y menhir conf-gtksourceview lablgtk ocamlgraph zarith camlzip
# Alt-Ergo
RUN opam install alt-ergo.1.30
# copy Why3 sources
COPY --chown=why3:why3 . why3
WORKDIR /home/why3/why3
FROM bench-image
RUN opam pin -v -y add why3 .
#!/bin/bash
set -e -x
autoconf && (automake --add-missing 2> /dev/null || true)
docker build -t bench-image-$COMPILER -f misc/Dockerfile.init --build-arg compiler=$COMPILER .
CID=$(docker create --rm -i -w /home/why3/why3 bench-image-$COMPILER /bin/sh)
docker start $CID
docker cp . $CID:/home/why3/why3
docker exec -u root $CID chown -R why3:why3 /home/why3/why3
docker attach $CID <<EOF
exec $@
EOF
#!/bin/sh
set -e
opam pin -v -y add why3 .
opam pin -v -y add why3-ide .
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