diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 80b99278e514b71e0e485830c3316d2e100e941d..80c7386c6351514cfb7d4e9c0e544daee7ee6cd5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,8 +1,53 @@ image: debian:stretch stages: + - docker-image - build +.debian-stretch-x86_64: + stage: docker-image + image: docker:stable + services: + - docker:dind + variables: + DISTRIBUTION: debian-stretch-x86_64 + before_script: + - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY + script: + - IMAGE_NAME="$CI_REGISTRY_IMAGE/$DISTRIBUTION" + - IMAGE_BRANCH="$IMAGE_NAME:$CI_COMMIT_REF_SLUG" + - IMAGE_UNIQUE="$IMAGE_NAME:$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHA-$CI_JOB_ID" + - IMAGE_LATEST="$IMAGE_NAME:latest" + - docker build -t "$IMAGE_UNIQUE" -t "$IMAGE_BRANCH" .gitlab-ci + - docker push "$IMAGE_UNIQUE" + - docker push "$IMAGE_BRANCH" + - | + if [ "$CI_COMMIT_REF_NAME" = "master" ]; then + docker tag "$IMAGE_UNIQUE" "$IMAGE_LATEST" + docker push "$IMAGE_LATEST" + echo "IMAGE_LATEST=$IMAGE_LATEST" + fi + - echo "IMAGE_BRANCH=$IMAGE_BRANCH" + - echo "IMAGE_UNIQUE=$IMAGE_UNIQUE" + +debian-stretch-x86_64: + extends: .debian-stretch-x86_64 + only: + refs: + - master + variables: + - $CI_REGISTRY == "registry.freedesktop.org/wayland/weston" + changes: + - .gitlab-ci/Dockerfile + +debian-stretch-x86_64-force: + extends: .debian-stretch-x86_64 + only: + refs: + - web + variables: + - $FORCE_DOCKER + before_script: - echo 'path-exclude=/usr/share/doc/*' > /etc/dpkg/dpkg.cfg.d/99-exclude-cruft - echo 'path-exclude=/usr/share/man/*' >> /etc/dpkg/dpkg.cfg.d/99-exclude-cruft diff --git a/.gitlab-ci/Dockerfile b/.gitlab-ci/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..b3273317dbe86f09f05cacee3047315517bf202e --- /dev/null +++ b/.gitlab-ci/Dockerfile @@ -0,0 +1,73 @@ +# Debian commands to prepare a Docker image for running Weston test suite + +# If you have work that depends on changes in this file: +# +# To generate a new image for your branch, use the Gitlab web UI to launch +# a new pipeline and define the variable FORCE_DOCKER to anything non-empty. +# +# You have to submit your work in two different MRs. +# +# The first MR contains the changes to the Docker image building (this file). +# +# The second MR will start as WIP until the first MR is merged, and needs to +# include the first MR. Add a temporary commit that changes the CI to use +# the your new image by the name $IMAGE_BRANCH instead of $IMAGE_LATEST as it +# is in upstream master. Add your new development on top. This allows CI to +# run on your second MR before it is merged. +# +# Once the first MR is merged upstream and the new $IMAGE_LATEST is generated, +# drop the temporary patch and update your second MR. Now CI will run your MR +# against the upstream $IMAGE_LATEST and will be mergeable as usual. + +FROM debian:stretch + +RUN echo 'path-exclude=/usr/share/doc/*' > /etc/dpkg/dpkg.cfg.d/99-exclude-cruft && \ + echo 'path-exclude=/usr/share/man/*' >> /etc/dpkg/dpkg.cfg.d/99-exclude-cruft && \ + echo '#!/bin/sh' > /usr/sbin/policy-rc.d && \ + echo 'exit 101' >> /usr/sbin/policy-rc.d && \ + chmod +x /usr/sbin/policy-rc.d && \ + apt-get update && \ + apt-get -y --no-install-recommends install \ + autoconf \ + automake \ + build-essential \ + git \ + libcairo2-dev \ + libcolord-dev \ + libegl1-mesa-dev \ + libexpat1-dev \ + libffi-dev \ + libgbm-dev \ + libgdk-pixbuf2.0-dev \ + libgles2-mesa-dev \ + libglu1-mesa-dev \ + libinput-dev \ + libjpeg-dev \ + libjpeg-dev \ + liblcms2-dev \ + libmtdev-dev \ + libpam0g-dev \ + libpango1.0-dev \ + libpixman-1-dev \ + libpng-dev \ + libsystemd-dev \ + libtool \ + libudev-dev \ + libva-dev \ + libvpx-dev \ + libwayland-dev \ + libwebp-dev \ + libx11-dev \ + libx11-xcb-dev \ + libxcb1-dev \ + libxcb-composite0-dev \ + libxcb-xfixes0-dev \ + libxcb-xkb-dev \ + libxcursor-dev \ + libxkbcommon-dev \ + libxml2-dev \ + mesa-common-dev \ + pkg-config \ + && \ + mkdir -p /tmp/.X11-unix && \ + chmod 777 /tmp/.X11-unix