CI: use wayland-ci-templates to manage the images
There shouldn't be a difference for users, but this way we do manage all of our containers from freedesktop.org Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
This commit is contained in:
parent
5a549c957a
commit
f706972309
|
@ -1,4 +1,4 @@
|
|||
# IMAGE_TAG is the tag of the docker image used for the build jobs. If the
|
||||
# DEBIAN_TAG is the tag of the docker image used for the build jobs. If the
|
||||
# image doesn't exist yet, the docker-image stage generates it.
|
||||
#
|
||||
# In order to generate a new image, one should generally change the tag.
|
||||
|
@ -13,40 +13,25 @@
|
|||
# container registry, so that the image from the main repository's registry
|
||||
# will be used there as well.
|
||||
variables:
|
||||
IMAGE_TAG: "debian-testing-20190219"
|
||||
IMAGE_LOCAL: "$CI_REGISTRY_IMAGE:$IMAGE_TAG"
|
||||
IMAGE_MAIN: "registry.freedesktop.org/xorg/xserver:$IMAGE_TAG"
|
||||
UPSTREAM_REPO: xorg/xserver
|
||||
DEBIAN_VERSION: testing-slim
|
||||
DEBIAN_EXEC: 'bash .gitlab-ci/debian-install.sh'
|
||||
|
||||
DEBIAN_TAG: "2019-03-27"
|
||||
IMAGE_LOCAL: "$CI_REGISTRY_IMAGE/debian/$DEBIAN_VERSION:$DEBIAN_TAG"
|
||||
|
||||
include:
|
||||
- project: 'wayland/ci-templates'
|
||||
ref: c73dae8b84697ef18e2dbbf4fed7386d9652b0cd
|
||||
file: '/templates/debian.yml'
|
||||
|
||||
stages:
|
||||
- docker-image
|
||||
- build-and-test
|
||||
|
||||
debian-testing:
|
||||
stage: docker-image
|
||||
image:
|
||||
name: gcr.io/kaniko-project/executor:debug
|
||||
entrypoint: [""]
|
||||
script:
|
||||
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
|
||||
- mkdir kaniko-context
|
||||
- |
|
||||
echo "FROM $IMAGE_LOCAL" > kaniko-context/Dockerfile
|
||||
# If the image exists in the local registry, skip to the build-and-test job
|
||||
set +e
|
||||
set -x
|
||||
/kaniko/executor --context kaniko-context --no-push && exit 0
|
||||
set +x
|
||||
set -e
|
||||
- |
|
||||
echo "FROM $IMAGE_MAIN" > kaniko-context/Dockerfile
|
||||
# Try to re-use the image from the main repository's registry, and if
|
||||
# that fails, generate a local image from scratch
|
||||
set +e
|
||||
set -x
|
||||
/kaniko/executor --context kaniko-context --destination $IMAGE_LOCAL && exit 0
|
||||
set +x
|
||||
set -e
|
||||
- /kaniko/executor --context $CI_PROJECT_DIR/.gitlab-ci --destination $IMAGE_LOCAL
|
||||
extends: .debian@container-ifnot-exists
|
||||
stage: docker-image
|
||||
|
||||
.common-build-and-test:
|
||||
stage: build-and-test
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
FROM debian:testing-slim
|
||||
|
||||
WORKDIR /tmp
|
||||
|
||||
RUN export DEBIAN_FRONTEND=noninteractive; \
|
||||
echo 'path-exclude=/usr/share/doc/*' > /etc/dpkg/dpkg.cfg.d/99-exclude-cruft && \
|
||||
echo 'path-exclude=/usr/share/locale/*' >> /etc/dpkg/dpkg.cfg.d/99-exclude-cruft && \
|
||||
echo 'path-exclude=/usr/share/man/*' >> /etc/dpkg/dpkg.cfg.d/99-exclude-cruft && \
|
||||
echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf && \
|
||||
echo '#!/bin/sh' > /usr/sbin/policy-rc.d && \
|
||||
echo 'exit 101' >> /usr/sbin/policy-rc.d && \
|
||||
chmod +x /usr/sbin/policy-rc.d && \
|
||||
echo 'deb-src https://deb.debian.org/debian testing main' >/etc/apt/sources.list.d/deb-src.list && \
|
||||
apt-get update && \
|
||||
apt-get install -y meson git ca-certificates ccache cmake automake autoconf libtool libwaffle-dev \
|
||||
libxkbcommon-dev python3-mako python3-numpy python3-six x11-utils x11-xserver-utils xauth xvfb && \
|
||||
apt-get build-dep -y xorg-server && \
|
||||
\
|
||||
cd /root && \
|
||||
git clone https://gitlab.freedesktop.org/mesa/piglit.git && cd piglit && \
|
||||
cmake -G Ninja -DPIGLIT_BUILD_GL_TESTS=OFF -DPIGLIT_BUILD_GLES1_TESTS=OFF \
|
||||
-DPIGLIT_BUILD_GLES2_TESTS=OFF -DPIGLIT_BUILD_GLES3_TESTS=OFF \
|
||||
-DPIGLIT_BUILD_DMA_BUF_TESTS=OFF -DPIGLIT_BUILD_GLX_TESTS=OFF && \
|
||||
ninja && \
|
||||
cd .. && \
|
||||
git clone https://gitlab.freedesktop.org/xorg/test/xts && \
|
||||
cd xts && ./autogen.sh && xvfb-run make -j$(nproc) && \
|
||||
cd .. && rm -rf piglit/.git xts/.git && \
|
||||
echo '[xts]' > piglit/piglit.conf && echo 'path=/root/xts' >> piglit/piglit.conf && \
|
||||
find -name \*.a -o -name \*.o | xargs rm && \
|
||||
\
|
||||
apt-get purge -y git cmake libwaffle-dev libxkbcommon-dev \
|
||||
x11-utils x11-xserver-utils xauth xvfb && \
|
||||
apt-get autoremove -y --purge && apt-get clean && \
|
||||
rm -f /var/lib/apt/lists/deb.debian.org_debian_dists_testing_*
|
36
.gitlab-ci/debian-install.sh
Normal file
36
.gitlab-ci/debian-install.sh
Normal file
|
@ -0,0 +1,36 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -o xtrace
|
||||
|
||||
echo 'deb-src https://deb.debian.org/debian testing main' > /etc/apt/sources.list.d/deb-src.list
|
||||
apt-get update
|
||||
apt-get install -y meson git ca-certificates ccache cmake automake autoconf libtool libwaffle-dev \
|
||||
libxkbcommon-dev python3-mako python3-numpy python3-six x11-utils x11-xserver-utils xauth xvfb
|
||||
apt-get build-dep -y xorg-server
|
||||
|
||||
cd /root
|
||||
git clone https://gitlab.freedesktop.org/mesa/piglit.git
|
||||
cd piglit
|
||||
cmake -G Ninja -DPIGLIT_BUILD_GL_TESTS=OFF -DPIGLIT_BUILD_GLES1_TESTS=OFF \
|
||||
-DPIGLIT_BUILD_GLES2_TESTS=OFF -DPIGLIT_BUILD_GLES3_TESTS=OFF \
|
||||
-DPIGLIT_BUILD_DMA_BUF_TESTS=OFF -DPIGLIT_BUILD_GLX_TESTS=OFF
|
||||
ninja
|
||||
cd ..
|
||||
|
||||
git clone https://gitlab.freedesktop.org/xorg/test/xts
|
||||
cd xts
|
||||
./autogen.sh
|
||||
xvfb-run make -j$(nproc)
|
||||
cd ..
|
||||
|
||||
rm -rf piglit/.git xts/.git
|
||||
|
||||
echo '[xts]' > piglit/piglit.conf
|
||||
echo 'path=/root/xts' >> piglit/piglit.conf
|
||||
|
||||
find -name \*.a -o -name \*.o | xargs rm
|
||||
|
||||
apt-get purge -y git cmake libwaffle-dev libxkbcommon-dev \
|
||||
x11-utils x11-xserver-utils xauth xvfb
|
||||
apt-get autoremove -y --purge
|
Loading…
Reference in New Issue
Block a user