]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
gitlabci: add distrotests to CI
authorTomas Krizek <tomas.krizek@nic.cz>
Thu, 30 May 2019 12:55:48 +0000 (14:55 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Tue, 11 Jun 2019 12:10:45 +0000 (14:10 +0200)
.gitlab-ci.yml

index f7ee93129df3b3e706776f999f61a5e1a611ac91..1eda54ec4699a315c8d715599e3204ef36081dcd 100644 (file)
@@ -5,6 +5,7 @@ variables:
   GIT_SUBMODULE_STRATEGY: recursive
   GIT_STRATEGY: clone # sometimes unclean submodule dirs otherwise
   RESPDIFF_PRIORITY: 5
+  DISTROTEST_PRIORITY: 6
   RESPDIFF_COUNT: 1
   RESPDIFF_FORCE: 0
   RESPERF_FORCE: 0
@@ -21,6 +22,7 @@ stages:
   - test
   - extended
   - deploy
+  - deploy-test
 
 # build {{{
 .build: &build
@@ -46,6 +48,7 @@ archive:
   variables:
     GIT_COMMITER_NAME: 'ci'
     EMAIL: 'ci@nic'
+  except: null
   script:
     - ./scripts/make-dev-archive.sh
 
@@ -442,20 +445,21 @@ resperf:iter.udp-asan:
 # }}}
 
 # deploy {{{
-pkg:obs:devel:
+obs:trigger:
   stage: deploy
   only:
     variables:
-      - $OBS_BUILD == "1"
-    refs:
-      - nightly@knot/knot-resolver
+      - $OBS_REPO
   dependencies:
     - archive
+  environment:
+    name: OBS/$OBS_REPO
+    url: https://build.opensuse.org/package/show/home:CZ-NIC:$OBS_REPO/knot-resolver
+  tags:
+    - respdiff
   script:
     - 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  # build against latest development version of knot
-    - scripts/build-in-obs.sh knot-resolver-devel  # build against knot in knot-resolver-latest
+    - scripts/build-in-obs.sh $OBS_REPO
 
 # copy snapshot of current master to nightly branch for further processing
 # (this is workaround for missing complex conditions for job limits in Gitlab)
@@ -475,3 +479,86 @@ nightly:copy:
     - 'curl --request POST --header "PRIVATE-TOKEN: $GITLAB_API_TOKEN" "https://gitlab.labs.nic.cz/api/v4/projects/147/repository/branches?branch=nightly&ref=master"'
     - 'curl --request PUT --header "PRIVATE-TOKEN: $GITLAB_API_TOKEN" "https://gitlab.labs.nic.cz/api/v4/projects/147/repository/branches/nightly/protect"'
 # }}}
+
+# deploy-test {{{
+.distrotest: &distrotest
+  stage: deploy-test
+  only:
+    variables:
+      - $OBS_REPO
+  when: delayed
+  start_in: 3 minutes  # give OBS build some time
+  tags:
+    - respdiff
+  script:
+    - "osc results home:CZ-NIC:$OBS_REPO knot-resolver -a x86_64 -r $DISTROTEST_REPO -w"
+    - >
+      osc results home:CZ-NIC:$OBS_REPO knot-resolver -a x86_64 -r $DISTROTEST_REPO --csv | grep 'succeeded|$' -q || \
+        (echo "ERROR: build failed"; exit 1)
+    - export LABEL=gl$(date +%s)
+    - 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)
+    - export EXITCODE=$(cat $TESTDIR/j*_exitcode)
+    - if [[ "$EXITCODE" != "0" ]]; then cat $TESTDIR/j*_vagrant.log; 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
+# }}}