Skip to content
Snippets Groups Projects
Verified Commit d875c8f9 authored by Tomas Krizek's avatar Tomas Krizek
Browse files

ci: add distrotests

parent 4d7ce008
Branches
Tags
1 merge request!1026ci: automate OBS builds and packaging tests
......@@ -4,6 +4,7 @@ variables:
GIT_STRATEGY: fetch
DOCKER_DRIVER: overlay2
GIT_SUBMODULE_STRATEGY: recursive
DISTROTEST_PRIORITY: 6
stages:
- image
......@@ -11,6 +12,7 @@ stages:
- test
- documentation
- deploy
- deploy-test
.image: &image
stage: image
......@@ -311,20 +313,24 @@ build:archive:
paths:
- _build/*.tar.xz
obs:devel:
obs:trigger:
<<: *debian_stable
stage: deploy
only:
variables:
- $SCHEDULE_TYPE == "nightly"
- $OBS_REPO
except: []
dependencies:
- build:archive
environment:
name: OBS/$OBS_REPO
url: https://build.opensuse.org/package/show/home:CZ-NIC:$OBS_REPO/knot
tags:
- respdiff
script:
- mv _build/*.tar.xz ./
- scripts/make-distrofiles.sh
- echo -e "[general]\napiurl = https://api.opensuse.org\n\n[https://api.opensuse.org]\nuser = CZ-NIC-automation\npass = $OBS_PASSWORD" > /root/.oscrc
- scripts/build-in-obs.sh knot-dns-devel
- scripts/build-in-obs.sh $OBS_REPO
build:documentation:
<<: *debian_stable
......@@ -362,3 +368,102 @@ deploy:documentation:
- doc/_build/html/
- doc/_build/singlehtml/
- doc/_build/latex/KnotDNS.pdf
.deploytest: &deploytest
stage: deploy-test
only:
variables:
- $OBS_REPO =~ /^knot-dns-devel|knot-dns-latest|knot-dns-testing$/
when: delayed
start_in: 3 minutes # give OBS build some time
tags:
- respdiff
obs:build:all:
<<: *deploytest
script:
- "osc results home:CZ-NIC:$OBS_REPO knot -w"
- version=$(sed 's/^v//' <(git describe --exact-match HEAD || git rev-parse --short HEAD) )
- > # check version only for one (reliable) repo to avoid false negatives
! osc ls -b home:CZ-NIC:$OBS_REPO knot Debian_9.0 x86_64 | \
grep -E '(rpm|deb|tar\.xz)$' | grep -v $version || \
(echo "ERROR: version mismatch"; exit 1)
- >
! osc results home:CZ-NIC:$OBS_REPO knot --csv | \
grep -Ev 'disabled|excluded|Rawhide' | grep -v 'succeeded' -q || \
(echo "ERROR: build(s) failed"; exit 1)
.distrotest: &distrotest
<<: *deploytest
script:
- "osc results home:CZ-NIC:$OBS_REPO knot -a x86_64 -r $DISTROTEST_REPO -w"
- >
osc results home:CZ-NIC:$OBS_REPO knot -a x86_64 -r $DISTROTEST_REPO --csv | grep 'succeeded|$' -q || \
(echo "ERROR: build failed"; exit 1)
- export LABEL="gl$(date +%s)_$OBS_REPO"
- export COMMITDIR="/var/tmp/respdiff-jobs/$(git rev-parse --short HEAD)-$LABEL"
- export TESTDIR="$COMMITDIR/distrotest.$DISTROTEST_NAME"
- ln -s $COMMITDIR distrotest_commitdir
- sudo -u respdiff /var/opt/respdiff/contrib/job_manager/submit.py -w
-p $DISTROTEST_PRIORITY
$(sudo -u respdiff /var/opt/respdiff/contrib/job_manager/create.py
"$(git rev-parse --short HEAD)" -l $LABEL -t distrotest.$DISTROTEST_NAME
--package knot-dns --obs-repo $OBS_REPO)
- export EXITCODE=$(cat $TESTDIR/j*_exitcode)
- if [[ "$EXITCODE" != "0" ]]; then cat $TESTDIR/j*_{vagrant.log.txt,stdout.txt}; fi
- exit $EXITCODE
after_script:
- 'cp -t . distrotest_commitdir/distrotest.$DISTROTEST_NAME/j* ||:'
artifacts:
when: always
expire_in: 1 week
paths:
- ./j*
obs:centos7:x86_64:
<<: *distrotest
variables:
DISTROTEST_NAME: centos7
DISTROTEST_REPO: CentOS_7_EPEL
obs:debian9:x86_64:
<<: *distrotest
variables:
DISTROTEST_NAME: debian9
DISTROTEST_REPO: Debian_9.0
obs:fedora29:x86_64:
<<: *distrotest
variables:
DISTROTEST_NAME: fedora29
DISTROTEST_REPO: Fedora_29
obs:fedora30:x86_64:
<<: *distrotest
variables:
DISTROTEST_NAME: fedora30
DISTROTEST_REPO: Fedora_30
obs:leap15:x86_64:
<<: *distrotest
variables:
DISTROTEST_NAME: leap15
DISTROTEST_REPO: openSUSE_Leap_15.0
obs:ubuntu1604:x86_64:
<<: *distrotest
variables:
DISTROTEST_NAME: ubuntu1604
DISTROTEST_REPO: xUbuntu_16.04
obs:ubuntu1804:x86_64:
<<: *distrotest
variables:
DISTROTEST_NAME: ubuntu1804
DISTROTEST_REPO: xUbuntu_18.04
obs:ubuntu1904:x86_64:
<<: *distrotest
variables:
DISTROTEST_NAME: ubuntu1904
DISTROTEST_REPO: xUbuntu_19.04
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