diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2020-10-30 09:19:11 +1000 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-11-09 09:28:11 +0100 |
commit | 35334f478bdb9e691122f041d07b337b1440a760 (patch) | |
tree | d6ed3dd5eda3a45071aaf400ae9fd3b27d7bf975 | |
parent | d6457902d127f2a29be4d12fe5b9ae94e3106b57 (diff) | |
download | NetworkManager-35334f478bdb9e691122f041d07b337b1440a760.tar.gz |
gitlab CI: switch to using ci-templates
ci-templates encourages building specific containers that can be re-used:
- containers are re-used across pipelines, producing consistent results
- containers are re-used by contributors since they will use the upstream
containers for their MR, thus guaranteeing the same results.
Containers are automatically rebuild whenever the respective
FDO_DISTRIBUTION_TAG changes. This is particularly interesting now that
Docker Hub will introduce pull limits.
This CI script consists of a config file and a jinja2 template, simply
running 'ci-fairy generate-template' produces the .gitlab-ci.yml.
ci-fairy is part of the freedesktop.org ci-templates and can be pip
installed, see the check-ci-script job.
Functional changes to the previous script:
- new job: check-ci-script, verifies that our gitlab-ci.yml is the one
generated by the sources
- Added distributions:
- Fedora 33
- The actual work is now down by a set of scripts in .gitlab-ci/,
specifically:
- .gitlab-ci/build.sh is the previous do_build job
- .gitlab-ci/{fedora|debian}-install.sh are the previous {fedora|debian}_install jobs
symlinks are in place for centos and ubuntu
Why the scripts instead of steps in the CI? Easer to reading and
reproduce. With the containers being static, it's easy to pull one
locally and re-run the CI job to reproduce an issue. Having everything in a
single script makes that trivial.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/664
-rw-r--r-- | .gitlab-ci.yml | 880 | ||||
-rwxr-xr-x | .gitlab-ci/build.sh | 19 | ||||
l--------- | .gitlab-ci/centos-install.sh | 1 | ||||
-rw-r--r-- | .gitlab-ci/ci.template | 228 | ||||
-rw-r--r-- | .gitlab-ci/config.yml | 55 | ||||
-rwxr-xr-x | .gitlab-ci/debian-install.sh | 14 | ||||
-rwxr-xr-x | .gitlab-ci/fedora-install.sh | 27 | ||||
l--------- | .gitlab-ci/ubuntu-install.sh | 1 |
8 files changed, 1059 insertions, 166 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e4708e3ca0..e40d33ebbf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,221 +1,767 @@ -# Quick syntax check: -# python -c 'import sys, yaml; yaml.dump (yaml.load (sys.stdin), sys.stdout)' <.gitlab-ci.yml - -# If things don't seem to work, this can help: -# https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/ci/lint +# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0 filetype=yaml: + +######################################## +# # +# THIS FILE IS GENERATED, DO NOT EDIT # +# # +######################################## + + +.templates_sha: &template_sha d303fafa66bbca44cc5bdb337d5773b5f019b70d # see https://docs.gitlab.com/ee/ci/yaml/#includefile + +include: + # Centos container builder template + - project: 'freedesktop/ci-templates' + ref: *template_sha + file: '/templates/centos.yml' + # Debian container builder template + - project: 'freedesktop/ci-templates' + ref: *template_sha + file: '/templates/debian.yml' + # Fedora container builder template + - project: 'freedesktop/ci-templates' + ref: *template_sha + file: '/templates/fedora.yml' + # Ubuntu container builder template + - project: 'freedesktop/ci-templates' + ref: *template_sha + file: '/templates/ubuntu.yml' stages: + - prep - test - deploy - triage + - container_clean + +variables: + FDO_UPSTREAM_REPO: NetworkManager/NetworkManager + GIT_DEPTH: 1 + # these tags should be updated each time the list of packages is updated + # changing these will force rebuilding the associated image + # Note: these tags have no meaning and are not tied to a particular + # libinput version + FEDORA_TAG: '2020-10-30.0' + UBUNTU_TAG: '2020-10-30.0' + DEBIAN_TAG: '2020-10-30.0' + CENTOS_TAG: '2020-10-30.0' + + FEDORA_EXEC: 'bash .gitlab-ci/fedora-install.sh' + UBUNTU_EXEC: 'bash .gitlab-ci/ubuntu-install.sh' + DEBIAN_EXEC: 'bash .gitlab-ci/debian-install.sh' + CENTOS_EXEC: 'bash .gitlab-ci/centos-install.sh' + +.nm_artifacts: + artifacts: + expire_in: 2 days + paths: + - docs-html + - NetworkManager-1*.tar.xz + - NetworkManager-1*.src.rpm -.fedora_install: &fedora_install +################################################################# +# # +# prep stage # +# # +################################################################# + +# Re-generate the .gitlab-ci.yml file and make sure it's the one currently checked in +# If this job fails, re-generate the gitlab-ci.yml script and git commit it. +# +check-ci-script: + image: golang:alpine + stage: prep before_script: + - apk add python3 py-pip git + - pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates + script: + - ci-fairy generate-template + - git diff --exit-code && exit 0 || true + - echo "Committed gitlab-ci.yml differs from generated gitlab-ci.yml. Please verify" + - exit 1 + +################################################################# +# # +# containers stage # +# # +################################################################# + +# Build a container for each distribution + version. The ci-templates +# will re-use the containers if the tag doesn't change. + +fedora:32@container-prep: + extends: + - .fdo.container-build@fedora + stage: prep + variables: + GIT_STRATEGY: none + FDO_DISTRIBUTION_VERSION: '32' + FDO_DISTRIBUTION_TAG: $FEDORA_TAG + FDO_DISTRIBUTION_EXEC: $FEDORA_EXEC + +fedora:33@container-prep: + extends: + - .fdo.container-build@fedora + stage: prep + variables: + GIT_STRATEGY: none + FDO_DISTRIBUTION_VERSION: '33' + FDO_DISTRIBUTION_TAG: $FEDORA_TAG + FDO_DISTRIBUTION_EXEC: $FEDORA_EXEC + when: manual - - date '+%Y%m%d-%H%M%S'; ! ( grep -q '^NAME=.*\(CentOS\)' /etc/os-release && grep -q '^VERSION_ID=.*\<7\>' /etc/os-release ) || yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm - - date '+%Y%m%d-%H%M%S'; ! ( grep -q '^NAME=.*\(CentOS\)' /etc/os-release && grep -q '^VERSION_ID=.*\<7\>' /etc/os-release ) || yum install -y glibc-common - - date '+%Y%m%d-%H%M%S'; ! ( grep -q '^NAME=.*\(CentOS\)' /etc/os-release && grep -q '^VERSION_ID=.*\<7\>' /etc/os-release ) || localedef -c -i pl_PL -f UTF-8 pl_PL.UTF-8 && locale -a - - date '+%Y%m%d-%H%M%S'; ! ( grep -q '^NAME=.*\(CentOS\)' /etc/os-release && grep -q '^VERSION_ID=.*\<7\>' /etc/os-release ) || yum install -y python36-dbus python36-gobject-base - - - date '+%Y%m%d-%H%M%S'; ! ( grep -q '^NAME=.*\(CentOS\)' /etc/os-release && grep -q '^VERSION_ID=.*\<8\>' /etc/os-release ) || dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm - - date '+%Y%m%d-%H%M%S'; ! ( grep -q '^NAME=.*\(CentOS\)' /etc/os-release && grep -q '^VERSION_ID=.*\<8\>' /etc/os-release ) || dnf install -y 'dnf-command(config-manager)' - - date '+%Y%m%d-%H%M%S'; ! ( grep -q '^NAME=.*\(CentOS\)' /etc/os-release && grep -q '^VERSION_ID=.*\<8\>' /etc/os-release ) || dnf config-manager --set-enabled PowerTools - - date '+%Y%m%d-%H%M%S'; ! ( grep -q '^NAME=.*\(CentOS\)' /etc/os-release && grep -q '^VERSION_ID=.*\<8\>' /etc/os-release ) || curl https://copr.fedorainfracloud.org/coprs/nmstate/nm-build-deps/repo/epel-8/nmstate-nm-build-deps-epel-8.repo > /etc/yum.repos.d/nmstate-nm-build-deps-epel-8.repo - - - date '+%Y%m%d-%H%M%S'; NM_NO_EXTRA=1 NM_INSTALL="yum install -y" ./contrib/fedora/REQUIRED_PACKAGES - - date '+%Y%m%d-%H%M%S'; yum install -y glibc-langpack-pl ccache clang which - - # containers have "tsflags=nodocs" in /etc/dnf/dnf.conf. We need /usr/shared/gtk-doc/html - # to generate proper documentation. - - date '+%Y%m%d-%H%M%S'; yum reinstall -y --setopt='tsflags=' glib2-doc - - - date '+%Y%m%d-%H%M%S'; ! which dnf || dnf install -y python3-dnf-plugins-core - - date '+%Y%m%d-%H%M%S'; ! which dnf || dnf debuginfo-install -y glib2 - - date '+%Y%m%d-%H%M%S'; which dnf || debuginfo-install -y glib2 - - - date '+%Y%m%d-%H%M%S'; contrib/scripts/nm-ci-patch-gtkdoc.sh || true - - - date '+%Y%m%d-%H%M%S'; test -x /usr/bin/ninja || ! test -x /usr/bin/ninja-build || ln -s /usr/bin/ninja-build /usr/bin/ninja +fedora:31@container-prep: + extends: + - .fdo.container-build@fedora + stage: prep + variables: + GIT_STRATEGY: none + FDO_DISTRIBUTION_VERSION: '31' + FDO_DISTRIBUTION_TAG: $FEDORA_TAG + FDO_DISTRIBUTION_EXEC: $FEDORA_EXEC + when: manual -.debian_install: &debian_install - before_script: - - date '+%Y%m%d-%H%M%S'; DEBIAN_FRONTEND=noninteractive apt-get update - - date '+%Y%m%d-%H%M%S'; DEBIAN_FRONTEND=noninteractive NM_INSTALL="apt-get -qq install -y" ./contrib/debian/REQUIRED_PACKAGES - - date '+%Y%m%d-%H%M%S'; dbus-uuidgen --ensure - - date '+%Y%m%d-%H%M%S'; sed -i 's/^# \(pl_PL.UTF-8 .*\)$/\1/p' /etc/locale.gen ; true - - date '+%Y%m%d-%H%M%S'; locale-gen pl_PL.UTF-8 - - date '+%Y%m%d-%H%M%S'; grep -q "VERSION=.16.04.[0-9]\+ LTS" /etc/os-release && pip3 install meson==0.53.2 - - date '+%Y%m%d-%H%M%S'; grep -q "VERSION=.16.04.[0-9]\+ LTS" /etc/os-release || pip3 install meson - - date '+%Y%m%d-%H%M%S'; contrib/scripts/nm-ci-install-valgrind-in-ubuntu1604.sh - - # iproute2 5.2.0 on debian:sid causes our unit tests to fail. - # Downgrade to a working version. See https://www.spinics.net/lists/netdev/msg584916.html - - date '+%Y%m%d-%H%M%S'; ! ( dpkg -s iproute2 | grep -q '^Version[:] 5.2.0-1\(ubuntu1\)\?$' ) || (curl 'http://ftp.debian.org/debian/pool/main/i/iproute2/iproute2_4.20.0-2_amd64.deb' --output /tmp/iproute2_4.20.0-2_amd64.deb && dpkg -i /tmp/iproute2_4.20.0-2_amd64.deb) - -.do_build: &do_build - stage: test - script: - - date '+%Y%m%d-%H%M%S'; uname -a - - date '+%Y%m%d-%H%M%S'; locale -a - - date '+%Y%m%d-%H%M%S'; env - - date '+%Y%m%d-%H%M%S'; meson --version - - date '+%Y%m%d-%H%M%S'; ! which dpkg || dpkg -l - - date '+%Y%m%d-%H%M%S'; ! which yum || yum list installed - - date '+%Y%m%d-%H%M%S'; git clean -fdx ; BUILD_TYPE=autotools CC=gcc WITH_DOCS=1 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh - - date '+%Y%m%d-%H%M%S'; rm -rf /tmp/nm-docs-html; mv build/INST/share/gtk-doc/html /tmp/nm-docs-html - - date '+%Y%m%d-%H%M%S'; git clean -fdx ; BUILD_TYPE=meson CC=gcc WITH_DOCS=1 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh - - date '+%Y%m%d-%H%M%S'; git clean -fdx ; BUILD_TYPE=autotools CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh - - date '+%Y%m%d-%H%M%S'; git clean -fdx ; BUILD_TYPE=meson CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh - - date '+%Y%m%d-%H%M%S'; git clean -fdx ; ! grep -q '^NAME=.*\(Fedora\|CentOS\)' /etc/os-release || ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -W meson - - date '+%Y%m%d-%H%M%S'; git clean -fdx ; ! grep -q '^NAME=.*\(Fedora\)' /etc/os-release || ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -w meson - - date '+%Y%m%d-%H%M%S'; git clean -fdx ; test "$NM_BUILD_TARBALL" != 1 || ( SIGN_SOURCE=0 ./contrib/fedora/rpm/build_clean.sh -r && mv ./NetworkManager-1*.tar.xz /tmp/ && mv ./contrib/fedora/rpm/latest/SRPMS/NetworkManager-1*.src.rpm /tmp/ ) - - date '+%Y%m%d-%H%M%S'; git clean -fdx - - date '+%Y%m%d-%H%M%S'; mv /tmp/nm-docs-html ./docs-html - - date '+%Y%m%d-%H%M%S'; test "$NM_BUILD_TARBALL" != 1 || mv /tmp/NetworkManager-1*.tar.xz /tmp/NetworkManager-1*.src.rpm ./ +fedora:30@container-prep: + extends: + - .fdo.container-build@fedora + stage: prep + variables: + GIT_STRATEGY: none + FDO_DISTRIBUTION_VERSION: '30' + FDO_DISTRIBUTION_TAG: $FEDORA_TAG + FDO_DISTRIBUTION_EXEC: $FEDORA_EXEC + when: manual -checkpatch: - image: fedora:33 - stage: test - script: - - date '+%Y%m%d-%H%M%S'; dnf install -y git black gettext /usr/bin/xargs which clang - - date '+%Y%m%d-%H%M%S'; NM_CHECKPATCH_FETCH_UPSTREAM=1 contrib/scripts/checkpatch-feature-branch.sh - - date '+%Y%m%d-%H%M%S'; black --check . examples/python/gi/nm-wg-set - - date '+%Y%m%d-%H%M%S'; git ls-files -z -- 'po/*.po' | xargs -0 -n1 msgfmt -vc - - date '+%Y%m%d-%H%M%S'; contrib/scripts/nm-code-format.sh - allow_failure: true +fedora:29@container-prep: + extends: + - .fdo.container-build@fedora + stage: prep + variables: + GIT_STRATEGY: none + FDO_DISTRIBUTION_VERSION: '29' + FDO_DISTRIBUTION_TAG: $FEDORA_TAG + FDO_DISTRIBUTION_EXEC: $FEDORA_EXEC + when: manual -t_fedora:28: - <<: *fedora_install - image: fedora:28 - <<: *do_build +fedora:28@container-prep: + extends: + - .fdo.container-build@fedora + stage: prep + variables: + GIT_STRATEGY: none + FDO_DISTRIBUTION_VERSION: '28' + FDO_DISTRIBUTION_TAG: $FEDORA_TAG + FDO_DISTRIBUTION_EXEC: $FEDORA_EXEC when: manual -t_fedora:29: - <<: *fedora_install - image: fedora:29 - <<: *do_build +fedora:rawhide@container-prep: + extends: + - .fdo.container-build@fedora + stage: prep + variables: + GIT_STRATEGY: none + FDO_DISTRIBUTION_VERSION: 'rawhide' + FDO_DISTRIBUTION_TAG: $FEDORA_TAG + FDO_DISTRIBUTION_EXEC: $FEDORA_EXEC when: manual -t_fedora:30: - <<: *fedora_install - image: fedora:30 - <<: *do_build +ubuntu:devel@container-prep: + extends: + - .fdo.container-build@ubuntu + stage: prep + variables: + GIT_STRATEGY: none + FDO_DISTRIBUTION_VERSION: 'devel' + FDO_DISTRIBUTION_TAG: $UBUNTU_TAG + FDO_DISTRIBUTION_EXEC: $UBUNTU_EXEC when: manual -t_fedora:31: - <<: *fedora_install - image: fedora:31 - <<: *do_build +ubuntu:rolling@container-prep: + extends: + - .fdo.container-build@ubuntu + stage: prep + variables: + GIT_STRATEGY: none + FDO_DISTRIBUTION_VERSION: 'rolling' + FDO_DISTRIBUTION_TAG: $UBUNTU_TAG + FDO_DISTRIBUTION_EXEC: $UBUNTU_EXEC when: manual -t_fedora:32: - <<: *fedora_install - image: fedora:32 - <<: *do_build +ubuntu:18.04@container-prep: + extends: + - .fdo.container-build@ubuntu + stage: prep variables: - NM_BUILD_TARBALL: 1 - artifacts: - expire_in: 2 days - paths: - - docs-html - - NetworkManager-1*.tar.xz - - NetworkManager-1*.src.rpm + GIT_STRATEGY: none + FDO_DISTRIBUTION_VERSION: '18.04' + FDO_DISTRIBUTION_TAG: $UBUNTU_TAG + FDO_DISTRIBUTION_EXEC: $UBUNTU_EXEC + when: manual -t_fedora:33: - <<: *fedora_install - image: fedora:33 - <<: *do_build +ubuntu:16.04@container-prep: + extends: + - .fdo.container-build@ubuntu + stage: prep + variables: + GIT_STRATEGY: none + FDO_DISTRIBUTION_VERSION: '16.04' + FDO_DISTRIBUTION_TAG: $UBUNTU_TAG + FDO_DISTRIBUTION_EXEC: $UBUNTU_EXEC when: manual -t_fedora:rawhide: - <<: *fedora_install - image: fedora:rawhide - <<: *do_build - allow_failure: true +debian:9@container-prep: + extends: + - .fdo.container-build@debian + stage: prep + variables: + GIT_STRATEGY: none + FDO_DISTRIBUTION_VERSION: '9' + FDO_DISTRIBUTION_TAG: $DEBIAN_TAG + FDO_DISTRIBUTION_EXEC: $DEBIAN_EXEC when: manual -t_centos:7.5.1804: - <<: *fedora_install - image: centos:7.5.1804 - <<: *do_build +debian:10@container-prep: + extends: + - .fdo.container-build@debian + stage: prep + variables: + GIT_STRATEGY: none + FDO_DISTRIBUTION_VERSION: '10' + FDO_DISTRIBUTION_TAG: $DEBIAN_TAG + FDO_DISTRIBUTION_EXEC: $DEBIAN_EXEC when: manual -t_centos:7.6.1810: - <<: *fedora_install - image: centos:7.6.1810 - <<: *do_build +debian:testing@container-prep: + extends: + - .fdo.container-build@debian + stage: prep + variables: + GIT_STRATEGY: none + FDO_DISTRIBUTION_VERSION: 'testing' + FDO_DISTRIBUTION_TAG: $DEBIAN_TAG + FDO_DISTRIBUTION_EXEC: $DEBIAN_EXEC when: manual -t_centos:7.7.1908: - <<: *fedora_install - image: centos:7.7.1908 - <<: *do_build +debian:sid@container-prep: + extends: + - .fdo.container-build@debian + stage: prep + variables: + GIT_STRATEGY: none + FDO_DISTRIBUTION_VERSION: 'sid' + FDO_DISTRIBUTION_TAG: $DEBIAN_TAG + FDO_DISTRIBUTION_EXEC: $DEBIAN_EXEC when: manual -t_centos:7.8.2003: - <<: *fedora_install - image: centos:7.8.2003 - <<: *do_build +centos:7.5.1804@container-prep: + extends: + - .fdo.container-build@centos + stage: prep + variables: + GIT_STRATEGY: none + FDO_DISTRIBUTION_VERSION: '7.5.1804' + FDO_DISTRIBUTION_TAG: $CENTOS_TAG + FDO_DISTRIBUTION_EXEC: $CENTOS_EXEC when: manual -t_centos:8.1.1911: - <<: *fedora_install - image: centos:8.1.1911 - <<: *do_build +centos:7.6.1810@container-prep: + extends: + - .fdo.container-build@centos + stage: prep + variables: + GIT_STRATEGY: none + FDO_DISTRIBUTION_VERSION: '7.6.1810' + FDO_DISTRIBUTION_TAG: $CENTOS_TAG + FDO_DISTRIBUTION_EXEC: $CENTOS_EXEC when: manual -t_ubuntu:16.04: - <<: *debian_install - image: ubuntu:16.04 - <<: *do_build +centos:7.7.1908@container-prep: + extends: + - .fdo.container-build@centos + stage: prep + variables: + GIT_STRATEGY: none + FDO_DISTRIBUTION_VERSION: '7.7.1908' + FDO_DISTRIBUTION_TAG: $CENTOS_TAG + FDO_DISTRIBUTION_EXEC: $CENTOS_EXEC when: manual -t_ubuntu:18.04: - <<: *debian_install - image: ubuntu:18.04 - <<: *do_build +centos:7.8.2003@container-prep: + extends: + - .fdo.container-build@centos + stage: prep + variables: + GIT_STRATEGY: none + FDO_DISTRIBUTION_VERSION: '7.8.2003' + FDO_DISTRIBUTION_TAG: $CENTOS_TAG + FDO_DISTRIBUTION_EXEC: $CENTOS_EXEC when: manual -t_ubuntu:rolling: - <<: *debian_install - image: ubuntu:rolling - <<: *do_build +centos:8.1.1911@container-prep: + extends: + - .fdo.container-build@centos + stage: prep + variables: + GIT_STRATEGY: none + FDO_DISTRIBUTION_VERSION: '8.1.1911' + FDO_DISTRIBUTION_TAG: $CENTOS_TAG + FDO_DISTRIBUTION_EXEC: $CENTOS_EXEC when: manual +################################################################# +# # +# container clean stage # +# run during the clean stage # +# # +################################################################# + +# +# This stage will look for the container images we currently have in +# the registry and will remove any that are not tagged with the provided +# $container_image:$tag +# +# This job only runs for a scheduled pipeline. +# +# Go to your Profile, Settings, Access Tokens +# Create a personal token with 'api' scope, copy the value. +# Go to CI/CD, Schedules, schedule a monthly job. +# Define a variable of type File named AUTHFILE. Content is that token +# value. +.container-clean: + stage: container_clean + image: golang:alpine + before_script: + - apk add python3 py-pip git + - pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates + script: + - ci-fairy -v --authfile $AUTHFILE delete-image + --repository $FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION + --exclude-tag $FDO_DISTRIBUTION_TAG + dependencies: [] + allow_failure: true + only: + - schedules + +fedora:32@container-clean: + extends: + - .container-clean + variables: + GIT_STRATEGY: none + CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/fedora/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG + FDO_DISTRIBUTION_VERSION: '32' + FDO_DISTRIBUTION_TAG: $FEDORA_TAG + +fedora:33@container-clean: + extends: + - .container-clean + variables: + GIT_STRATEGY: none + CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/fedora/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG + FDO_DISTRIBUTION_VERSION: '33' + FDO_DISTRIBUTION_TAG: $FEDORA_TAG + +fedora:31@container-clean: + extends: + - .container-clean + variables: + GIT_STRATEGY: none + CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/fedora/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG + FDO_DISTRIBUTION_VERSION: '31' + FDO_DISTRIBUTION_TAG: $FEDORA_TAG + +fedora:30@container-clean: + extends: + - .container-clean + variables: + GIT_STRATEGY: none + CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/fedora/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG + FDO_DISTRIBUTION_VERSION: '30' + FDO_DISTRIBUTION_TAG: $FEDORA_TAG + +fedora:29@container-clean: + extends: + - .container-clean + variables: + GIT_STRATEGY: none + CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/fedora/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG + FDO_DISTRIBUTION_VERSION: '29' + FDO_DISTRIBUTION_TAG: $FEDORA_TAG + +fedora:28@container-clean: + extends: + - .container-clean + variables: + GIT_STRATEGY: none + CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/fedora/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG + FDO_DISTRIBUTION_VERSION: '28' + FDO_DISTRIBUTION_TAG: $FEDORA_TAG + +fedora:rawhide@container-clean: + extends: + - .container-clean + variables: + GIT_STRATEGY: none + CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/fedora/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG + FDO_DISTRIBUTION_VERSION: 'rawhide' + FDO_DISTRIBUTION_TAG: $FEDORA_TAG + +ubuntu:devel@container-clean: + extends: + - .container-clean + variables: + GIT_STRATEGY: none + CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/ubuntu/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG + FDO_DISTRIBUTION_VERSION: 'devel' + FDO_DISTRIBUTION_TAG: $UBUNTU_TAG + +ubuntu:rolling@container-clean: + extends: + - .container-clean + variables: + GIT_STRATEGY: none + CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/ubuntu/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG + FDO_DISTRIBUTION_VERSION: 'rolling' + FDO_DISTRIBUTION_TAG: $UBUNTU_TAG + +ubuntu:18.04@container-clean: + extends: + - .container-clean + variables: + GIT_STRATEGY: none + CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/ubuntu/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG + FDO_DISTRIBUTION_VERSION: '18.04' + FDO_DISTRIBUTION_TAG: $UBUNTU_TAG + +ubuntu:16.04@container-clean: + extends: + - .container-clean + variables: + GIT_STRATEGY: none + CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/ubuntu/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG + FDO_DISTRIBUTION_VERSION: '16.04' + FDO_DISTRIBUTION_TAG: $UBUNTU_TAG + +debian:9@container-clean: + extends: + - .container-clean + variables: + GIT_STRATEGY: none + CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/debian/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG + FDO_DISTRIBUTION_VERSION: '9' + FDO_DISTRIBUTION_TAG: $DEBIAN_TAG + +debian:10@container-clean: + extends: + - .container-clean + variables: + GIT_STRATEGY: none + CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/debian/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG + FDO_DISTRIBUTION_VERSION: '10' + FDO_DISTRIBUTION_TAG: $DEBIAN_TAG + +debian:testing@container-clean: + extends: + - .container-clean + variables: + GIT_STRATEGY: none + CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/debian/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG + FDO_DISTRIBUTION_VERSION: 'testing' + FDO_DISTRIBUTION_TAG: $DEBIAN_TAG + +debian:sid@container-clean: + extends: + - .container-clean + variables: + GIT_STRATEGY: none + CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/debian/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG + FDO_DISTRIBUTION_VERSION: 'sid' + FDO_DISTRIBUTION_TAG: $DEBIAN_TAG + +centos:7.5.1804@container-clean: + extends: + - .container-clean + variables: + GIT_STRATEGY: none + CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/centos/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG + FDO_DISTRIBUTION_VERSION: '7.5.1804' + FDO_DISTRIBUTION_TAG: $CENTOS_TAG + +centos:7.6.1810@container-clean: + extends: + - .container-clean + variables: + GIT_STRATEGY: none + CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/centos/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG + FDO_DISTRIBUTION_VERSION: '7.6.1810' + FDO_DISTRIBUTION_TAG: $CENTOS_TAG + +centos:7.7.1908@container-clean: + extends: + - .container-clean + variables: + GIT_STRATEGY: none + CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/centos/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG + FDO_DISTRIBUTION_VERSION: '7.7.1908' + FDO_DISTRIBUTION_TAG: $CENTOS_TAG + +centos:7.8.2003@container-clean: + extends: + - .container-clean + variables: + GIT_STRATEGY: none + CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/centos/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG + FDO_DISTRIBUTION_VERSION: '7.8.2003' + FDO_DISTRIBUTION_TAG: $CENTOS_TAG + +centos:8.1.1911@container-clean: + extends: + - .container-clean + variables: + GIT_STRATEGY: none + CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/centos/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG + FDO_DISTRIBUTION_VERSION: '8.1.1911' + FDO_DISTRIBUTION_TAG: $CENTOS_TAG + + +################################################################# +# # +# build stage # +# # +################################################################# + +.build@template: + stage: test + script: + - .gitlab-ci/build.sh + dependencies: [] + +################################################################# +# # +# test stage # +# # +################################################################# + + +t_fedora:32: + extends: + - .build@template + - .fdo.distribution-image@fedora + - .nm_artifacts + variables: + FDO_DISTRIBUTION_VERSION: '32' + FDO_DISTRIBUTION_TAG: $FEDORA_TAG + needs: + - "fedora:32@container-prep" + +t_fedora:33: + extends: + - .build@template + - .fdo.distribution-image@fedora + variables: + FDO_DISTRIBUTION_VERSION: '33' + FDO_DISTRIBUTION_TAG: $FEDORA_TAG + needs: + - "fedora:33@container-prep" + +t_fedora:31: + extends: + - .build@template + - .fdo.distribution-image@fedora + variables: + FDO_DISTRIBUTION_VERSION: '31' + FDO_DISTRIBUTION_TAG: $FEDORA_TAG + needs: + - "fedora:31@container-prep" + +t_fedora:30: + extends: + - .build@template + - .fdo.distribution-image@fedora + variables: + FDO_DISTRIBUTION_VERSION: '30' + FDO_DISTRIBUTION_TAG: $FEDORA_TAG + needs: + - "fedora:30@container-prep" + +t_fedora:29: + extends: + - .build@template + - .fdo.distribution-image@fedora + variables: + FDO_DISTRIBUTION_VERSION: '29' + FDO_DISTRIBUTION_TAG: $FEDORA_TAG + needs: + - "fedora:29@container-prep" + +t_fedora:28: + extends: + - .build@template + - .fdo.distribution-image@fedora + variables: + FDO_DISTRIBUTION_VERSION: '28' + FDO_DISTRIBUTION_TAG: $FEDORA_TAG + needs: + - "fedora:28@container-prep" + +t_fedora:rawhide: + extends: + - .build@template + - .fdo.distribution-image@fedora + variables: + FDO_DISTRIBUTION_VERSION: 'rawhide' + FDO_DISTRIBUTION_TAG: $FEDORA_TAG + needs: + - "fedora:rawhide@container-prep" + t_ubuntu:devel: - <<: *debian_install - image: ubuntu:devel - <<: *do_build - when: manual + extends: + - .build@template + - .fdo.distribution-image@ubuntu + variables: + FDO_DISTRIBUTION_VERSION: 'devel' + FDO_DISTRIBUTION_TAG: $UBUNTU_TAG + needs: + - "ubuntu:devel@container-prep" + +t_ubuntu:rolling: + extends: + - .build@template + - .fdo.distribution-image@ubuntu + variables: + FDO_DISTRIBUTION_VERSION: 'rolling' + FDO_DISTRIBUTION_TAG: $UBUNTU_TAG + needs: + - "ubuntu:rolling@container-prep" + +t_ubuntu:18.04: + extends: + - .build@template + - .fdo.distribution-image@ubuntu + variables: + FDO_DISTRIBUTION_VERSION: '18.04' + FDO_DISTRIBUTION_TAG: $UBUNTU_TAG + needs: + - "ubuntu:18.04@container-prep" + +t_ubuntu:16.04: + extends: + - .build@template + - .fdo.distribution-image@ubuntu + variables: + FDO_DISTRIBUTION_VERSION: '16.04' + FDO_DISTRIBUTION_TAG: $UBUNTU_TAG + needs: + - "ubuntu:16.04@container-prep" t_debian:9: - <<: *debian_install - image: debian:stretch - <<: *do_build - when: manual + extends: + - .build@template + - .fdo.distribution-image@debian + variables: + FDO_DISTRIBUTION_VERSION: '9' + FDO_DISTRIBUTION_TAG: $DEBIAN_TAG + needs: + - "debian:9@container-prep" t_debian:10: - <<: *debian_install - image: debian:stretch - <<: *do_build - when: manual + extends: + - .build@template + - .fdo.distribution-image@debian + variables: + FDO_DISTRIBUTION_VERSION: '10' + FDO_DISTRIBUTION_TAG: $DEBIAN_TAG + needs: + - "debian:10@container-prep" t_debian:testing: - <<: *debian_install - image: debian:testing - <<: *do_build - when: manual + extends: + - .build@template + - .fdo.distribution-image@debian + variables: + FDO_DISTRIBUTION_VERSION: 'testing' + FDO_DISTRIBUTION_TAG: $DEBIAN_TAG + needs: + - "debian:testing@container-prep" t_debian:sid: - <<: *debian_install - image: debian:sid - <<: *do_build - when: manual + extends: + - .build@template + - .fdo.distribution-image@debian + variables: + FDO_DISTRIBUTION_VERSION: 'sid' + FDO_DISTRIBUTION_TAG: $DEBIAN_TAG + needs: + - "debian:sid@container-prep" + +t_centos:7.5.1804: + extends: + - .build@template + - .fdo.distribution-image@centos + variables: + FDO_DISTRIBUTION_VERSION: '7.5.1804' + FDO_DISTRIBUTION_TAG: $CENTOS_TAG + needs: + - "centos:7.5.1804@container-prep" + +t_centos:7.6.1810: + extends: + - .build@template + - .fdo.distribution-image@centos + variables: + FDO_DISTRIBUTION_VERSION: '7.6.1810' + FDO_DISTRIBUTION_TAG: $CENTOS_TAG + needs: + - "centos:7.6.1810@container-prep" + +t_centos:7.7.1908: + extends: + - .build@template + - .fdo.distribution-image@centos + variables: + FDO_DISTRIBUTION_VERSION: '7.7.1908' + FDO_DISTRIBUTION_TAG: $CENTOS_TAG + needs: + - "centos:7.7.1908@container-prep" + +t_centos:7.8.2003: + extends: + - .build@template + - .fdo.distribution-image@centos + variables: + FDO_DISTRIBUTION_VERSION: '7.8.2003' + FDO_DISTRIBUTION_TAG: $CENTOS_TAG + needs: + - "centos:7.8.2003@container-prep" + +t_centos:8.1.1911: + extends: + - .build@template + - .fdo.distribution-image@centos + variables: + FDO_DISTRIBUTION_VERSION: '8.1.1911' + FDO_DISTRIBUTION_TAG: $CENTOS_TAG + needs: + - "centos:8.1.1911@container-prep" + +################################################################# +# # +# specific jobs # +# # +################################################################# +checkpatch: + extends: + - t_fedora:32 + stage: test + script: + - date '+%Y%m%d-%H%M%S'; dnf install -y git black gettext /usr/bin/xargs which clang + - date '+%Y%m%d-%H%M%S'; NM_CHECKPATCH_FETCH_UPSTREAM=1 contrib/scripts/checkpatch-feature-branch.sh + - date '+%Y%m%d-%H%M%S'; black --check . examples/python/gi/nm-wg-set + - date '+%Y%m%d-%H%M%S'; git ls-files -z -- 'po/*.po' | xargs -0 -n1 msgfmt -vc + - date '+%Y%m%d-%H%M%S'; contrib/scripts/nm-code-format.sh + allow_failure: true pages: stage: deploy - dependencies: - - t_fedora:32 script: - mv docs-html public artifacts: @@ -224,6 +770,8 @@ pages: - public only: - master + dependencies: + - t_fedora:32 triage:issues: stage: triage @@ -232,4 +780,4 @@ triage:issues: - gem install gitlab-triage - gitlab-triage -d --token $API_TOKEN --source-id $SOURCE_ID only: - - schedules + - schedules
\ No newline at end of file diff --git a/.gitlab-ci/build.sh b/.gitlab-ci/build.sh new file mode 100755 index 0000000000..5f8906ec57 --- /dev/null +++ b/.gitlab-ci/build.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +date '+%Y%m%d-%H%M%S'; uname -a +date '+%Y%m%d-%H%M%S'; locale -a +date '+%Y%m%d-%H%M%S'; env +date '+%Y%m%d-%H%M%S'; meson --version +date '+%Y%m%d-%H%M%S'; ! which dpkg || dpkg -l +date '+%Y%m%d-%H%M%S'; ! which yum || yum list installed +date '+%Y%m%d-%H%M%S'; git clean -fdx ; BUILD_TYPE=autotools CC=gcc WITH_DOCS=1 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh +date '+%Y%m%d-%H%M%S'; rm -rf /tmp/nm-docs-html; mv build/INST/share/gtk-doc/html /tmp/nm-docs-html +date '+%Y%m%d-%H%M%S'; git clean -fdx ; BUILD_TYPE=meson CC=gcc WITH_DOCS=1 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh +date '+%Y%m%d-%H%M%S'; git clean -fdx ; BUILD_TYPE=autotools CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh +date '+%Y%m%d-%H%M%S'; git clean -fdx ; BUILD_TYPE=meson CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh +date '+%Y%m%d-%H%M%S'; git clean -fdx ; ! grep -q '^NAME=.*\(Fedora\|CentOS\)' /etc/os-release || ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -W meson +date '+%Y%m%d-%H%M%S'; git clean -fdx ; ! grep -q '^NAME=.*\(Fedora\)' /etc/os-release || ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -w meson +date '+%Y%m%d-%H%M%S'; git clean -fdx ; test "$NM_BUILD_TARBALL" != 1 || ( SIGN_SOURCE=0 ./contrib/fedora/rpm/build_clean.sh -r && mv ./NetworkManager-1*.tar.xz /tmp/ && mv ./contrib/fedora/rpm/latest/SRPMS/NetworkManager-1*.src.rpm /tmp/ ) +date '+%Y%m%d-%H%M%S'; git clean -fdx +date '+%Y%m%d-%H%M%S'; mv /tmp/nm-docs-html ./docs-html +date '+%Y%m%d-%H%M%S'; test "$NM_BUILD_TARBALL" != 1 || mv /tmp/NetworkManager-1*.tar.xz /tmp/NetworkManager-1*.src.rpm ./ diff --git a/.gitlab-ci/centos-install.sh b/.gitlab-ci/centos-install.sh new file mode 120000 index 0000000000..78d48447af --- /dev/null +++ b/.gitlab-ci/centos-install.sh @@ -0,0 +1 @@ +fedora-install.sh
\ No newline at end of file diff --git a/.gitlab-ci/ci.template b/.gitlab-ci/ci.template new file mode 100644 index 0000000000..9f67dd7891 --- /dev/null +++ b/.gitlab-ci/ci.template @@ -0,0 +1,228 @@ +# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0 filetype=yaml: + +{# You're looking at the template here, so you can ignore the below + warning. This is the right file to edit #} +######################################## +# # +# THIS FILE IS GENERATED, DO NOT EDIT # +# # +######################################## + + +.templates_sha: &template_sha d303fafa66bbca44cc5bdb337d5773b5f019b70d # see https://docs.gitlab.com/ee/ci/yaml/#includefile + +include: +{% for distro in distributions|sort(attribute="name") %} + # {{ distro.name.capitalize() }} container builder template + - project: 'freedesktop/ci-templates' + ref: *template_sha + file: '/templates/{{distro.name}}.yml' +{% endfor %} + +stages: + - prep + - test + - deploy + - triage + - container_clean + +variables: + FDO_UPSTREAM_REPO: NetworkManager/NetworkManager + GIT_DEPTH: 1 + # these tags should be updated each time the list of packages is updated + # changing these will force rebuilding the associated image + # Note: these tags have no meaning and are not tied to a particular + # libinput version +{% for distro in distributions %} + {{"%-13s"| format(distro.name.upper() + '_TAG:')}}'{{distro.tag}}' +{% endfor %} + +{% for distro in distributions %} + {{"%-13s"| format(distro.name.upper() + '_EXEC:')}}'bash .gitlab-ci/{{distro.name}}-install.sh' +{% endfor %} + +.nm_artifacts: + artifacts: + expire_in: 2 days + paths: + - docs-html + - NetworkManager-1*.tar.xz + - NetworkManager-1*.src.rpm + +################################################################# +# # +# prep stage # +# # +################################################################# + +# Re-generate the .gitlab-ci.yml file and make sure it's the one currently checked in +# If this job fails, re-generate the gitlab-ci.yml script and git commit it. +# +check-ci-script: + image: golang:alpine + stage: prep + before_script: + - apk add python3 py-pip git + - pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates + script: + - ci-fairy generate-template + - git diff --exit-code && exit 0 || true + - echo "Committed gitlab-ci.yml differs from generated gitlab-ci.yml. Please verify" + - exit 1 + +################################################################# +# # +# containers stage # +# # +################################################################# + +# Build a container for each distribution + version. The ci-templates +# will re-use the containers if the tag doesn't change. +{% for distro in distributions %} +{% for version in distro.versions %} + +{{distro.name}}:{{version}}@container-prep: + extends: + - .fdo.container-build@{{distro.name}} + stage: prep + variables: + GIT_STRATEGY: none + FDO_DISTRIBUTION_VERSION: '{{version}}' + FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG + FDO_DISTRIBUTION_EXEC: ${{distro.name.upper()}}_EXEC +{% if not version in distro.always %} + when: manual +{% endif %} +{% endfor %} +{% endfor %} + +################################################################# +# # +# container clean stage # +# run during the clean stage # +# # +################################################################# + +# +# This stage will look for the container images we currently have in +# the registry and will remove any that are not tagged with the provided +# $container_image:$tag +# +# This job only runs for a scheduled pipeline. +# +# Go to your Profile, Settings, Access Tokens +# Create a personal token with 'api' scope, copy the value. +# Go to CI/CD, Schedules, schedule a monthly job. +# Define a variable of type File named AUTHFILE. Content is that token +# value. +.container-clean: + stage: container_clean + image: golang:alpine + before_script: + - apk add python3 py-pip git + - pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates + script: + - ci-fairy -v --authfile $AUTHFILE delete-image + --repository $FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION + --exclude-tag $FDO_DISTRIBUTION_TAG + dependencies: [] + allow_failure: true + only: + - schedules + +{% for distro in distributions %} +{% for version in distro.versions %} +{{distro.name}}:{{version}}@container-clean: + extends: + - .container-clean + variables: + GIT_STRATEGY: none + CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/{{distro.name}}/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG + FDO_DISTRIBUTION_VERSION: '{{version}}' + FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG + +{% endfor %} +{% endfor %} + +################################################################# +# # +# build stage # +# # +################################################################# + +.build@template: + stage: test + script: + - .gitlab-ci/build.sh + dependencies: [] + +################################################################# +# # +# test stage # +# # +################################################################# + +{% for distro in distributions %} +{% for version in distro.versions %} + +t_{{distro.name}}:{{version}}: + extends: + - .build@template + - .fdo.distribution-image@{{distro.name}} +{% if distro.name == pages_build.name and + version == pages_build.version %} + - .nm_artifacts +{% endif %} + variables: + FDO_DISTRIBUTION_VERSION: '{{version}}' + FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG + {# Where we have extra_variables defined, add them to the list #} + {% if distro.build is defined and distro.build.extra_variables is defined %} + {% for var in distro.build.extra_variables %} + {{var}} + {% endfor %} + {% endif %} + needs: + - "{{distro.name}}:{{version}}@container-prep" +{% endfor %} +{% endfor %} + +################################################################# +# # +# specific jobs # +# # +################################################################# +checkpatch: + extends: + {# run checkpatch on the same image that generates pages because why not #} + - t_{{pages_build.name}}:{{pages_build.version}} + stage: test + script: + - date '+%Y%m%d-%H%M%S'; dnf install -y git black gettext /usr/bin/xargs which clang + - date '+%Y%m%d-%H%M%S'; NM_CHECKPATCH_FETCH_UPSTREAM=1 contrib/scripts/checkpatch-feature-branch.sh + - date '+%Y%m%d-%H%M%S'; black --check . examples/python/gi/nm-wg-set + - date '+%Y%m%d-%H%M%S'; git ls-files -z -- 'po/*.po' | xargs -0 -n1 msgfmt -vc + - date '+%Y%m%d-%H%M%S'; contrib/scripts/nm-code-format.sh + allow_failure: true + +pages: + stage: deploy + script: + - mv docs-html public + artifacts: + expire_in: 20 days + paths: + - public + only: + - master + dependencies: + - t_{{pages_build.name}}:{{pages_build.version}} + +triage:issues: + stage: triage + image: ruby:2.7 + script: + - gem install gitlab-triage + - gitlab-triage -d --token $API_TOKEN --source-id $SOURCE_ID + only: + - schedules diff --git a/.gitlab-ci/config.yml b/.gitlab-ci/config.yml new file mode 100644 index 0000000000..1e0d2b0b46 --- /dev/null +++ b/.gitlab-ci/config.yml @@ -0,0 +1,55 @@ +# This file contains the configuration for the gitlab ci. +# +# To recreate the .gitlab-ci.yml file, run +# ci-fairy generate-template +# +# The ci-fairy tool is part of +# https://gitlab.freedesktop.org/freedesktop/ci-templates +# + +# We're happy to rebuild all containers when one changes. +.default_tag: &default_tag '2020-10-30.0' + + +# The list of all distributions we want to create job for. +# The template generates manual jobs for all these. +distributions: + - name: fedora + tag: *default_tag + versions: + - '32' + - '33' + - '31' + - '30' + - '29' + - '28' + - 'rawhide' + always: + - '32' + - name: ubuntu + tag: *default_tag + versions: + - 'devel' + - 'rolling' + - '18.04' + - '16.04' + - name: debian + tag: *default_tag + versions: + - '9' + - '10' + - 'testing' + - 'sid' + - name: centos + tag: *default_tag + versions: + - '7.5.1804' + - '7.6.1810' + - '7.7.1908' + - '7.8.2003' + - '8.1.1911' + +# specifies which of the above distros is used as source for pages +pages_build: + name: fedora + version: '32' diff --git a/.gitlab-ci/debian-install.sh b/.gitlab-ci/debian-install.sh new file mode 100755 index 0000000000..ee7f862e03 --- /dev/null +++ b/.gitlab-ci/debian-install.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +date '+%Y%m%d-%H%M%S'; DEBIAN_FRONTEND=noninteractive apt-get update +date '+%Y%m%d-%H%M%S'; DEBIAN_FRONTEND=noninteractive NM_INSTALL="apt-get -qq install -y" ./contrib/debian/REQUIRED_PACKAGES +date '+%Y%m%d-%H%M%S'; dbus-uuidgen --ensure +date '+%Y%m%d-%H%M%S'; sed -i 's/^# \(pl_PL.UTF-8 .*\)$/\1/p' /etc/locale.gen ; true +date '+%Y%m%d-%H%M%S'; locale-gen pl_PL.UTF-8 +date '+%Y%m%d-%H%M%S'; grep -q "VERSION=.16.04.[0-9]\+ LTS" /etc/os-release && pip3 install meson==0.53.2 +date '+%Y%m%d-%H%M%S'; grep -q "VERSION=.16.04.[0-9]\+ LTS" /etc/os-release || pip3 install meson +date '+%Y%m%d-%H%M%S'; contrib/scripts/nm-ci-install-valgrind-in-ubuntu1604.sh + +# iproute2 5.2.0 on debian:sid causes our unit tests to fail. +# Downgrade to a working version. See https://www.spinics.net/lists/netdev/msg584916.html +date '+%Y%m%d-%H%M%S'; ! ( dpkg -s iproute2 | grep -q '^Version[:] 5.2.0-1\(ubuntu1\)\?$' ) || (curl 'http://ftp.debian.org/debian/pool/main/i/iproute2/iproute2_4.20.0-2_amd64.deb' --output /tmp/iproute2_4.20.0-2_amd64.deb && dpkg -i /tmp/iproute2_4.20.0-2_amd64.deb) diff --git a/.gitlab-ci/fedora-install.sh b/.gitlab-ci/fedora-install.sh new file mode 100755 index 0000000000..9c8258e5e5 --- /dev/null +++ b/.gitlab-ci/fedora-install.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +date '+%Y%m%d-%H%M%S'; ! ( grep -q '^NAME=.*\(CentOS\)' /etc/os-release && grep -q '^VERSION_ID=.*\<7\>' /etc/os-release ) || yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm +date '+%Y%m%d-%H%M%S'; ! ( grep -q '^NAME=.*\(CentOS\)' /etc/os-release && grep -q '^VERSION_ID=.*\<7\>' /etc/os-release ) || yum install -y glibc-common +date '+%Y%m%d-%H%M%S'; ! ( grep -q '^NAME=.*\(CentOS\)' /etc/os-release && grep -q '^VERSION_ID=.*\<7\>' /etc/os-release ) || localedef -c -i pl_PL -f UTF-8 pl_PL.UTF-8 && locale -a +date '+%Y%m%d-%H%M%S'; ! ( grep -q '^NAME=.*\(CentOS\)' /etc/os-release && grep -q '^VERSION_ID=.*\<7\>' /etc/os-release ) || yum install -y python36-dbus python36-gobject-base + +date '+%Y%m%d-%H%M%S'; ! ( grep -q '^NAME=.*\(CentOS\)' /etc/os-release && grep -q '^VERSION_ID=.*\<8\>' /etc/os-release ) || dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm +date '+%Y%m%d-%H%M%S'; ! ( grep -q '^NAME=.*\(CentOS\)' /etc/os-release && grep -q '^VERSION_ID=.*\<8\>' /etc/os-release ) || dnf install -y 'dnf-command(config-manager)' +date '+%Y%m%d-%H%M%S'; ! ( grep -q '^NAME=.*\(CentOS\)' /etc/os-release && grep -q '^VERSION_ID=.*\<8\>' /etc/os-release ) || dnf config-manager --set-enabled PowerTools +date '+%Y%m%d-%H%M%S'; ! ( grep -q '^NAME=.*\(CentOS\)' /etc/os-release && grep -q '^VERSION_ID=.*\<8\>' /etc/os-release ) || curl https://copr.fedorainfracloud.org/coprs/nmstate/nm-build-deps/repo/epel-8/nmstate-nm-build-deps-epel-8.repo > /etc/yum.repos.d/nmstate-nm-build-deps-epel-8.repo + +date '+%Y%m%d-%H%M%S'; NM_NO_EXTRA=1 NM_INSTALL="yum install -y" ./contrib/fedora/REQUIRED_PACKAGES +date '+%Y%m%d-%H%M%S'; yum install -y glibc-langpack-pl ccache clang which + +# containers have "tsflags=nodocs" in /etc/dnf/dnf.conf. We need /usr/shared/gtk-doc/html +# to generate proper documentation. +date '+%Y%m%d-%H%M%S'; yum reinstall -y --setopt='tsflags=' glib2-doc + +date '+%Y%m%d-%H%M%S'; ! which dnf || dnf install -y python3-dnf-plugins-core +date '+%Y%m%d-%H%M%S'; ! which dnf || dnf debuginfo-install -y glib2 +date '+%Y%m%d-%H%M%S'; which dnf || debuginfo-install -y glib2 + +date '+%Y%m%d-%H%M%S'; contrib/scripts/nm-ci-patch-gtkdoc.sh || true + +date '+%Y%m%d-%H%M%S'; test -x /usr/bin/ninja || ! test -x /usr/bin/ninja-build || ln -s /usr/bin/ninja-build /usr/bin/ninja + diff --git a/.gitlab-ci/ubuntu-install.sh b/.gitlab-ci/ubuntu-install.sh new file mode 120000 index 0000000000..39fe97d493 --- /dev/null +++ b/.gitlab-ci/ubuntu-install.sh @@ -0,0 +1 @@ +debian-install.sh
\ No newline at end of file |