[Libguestfs] [libnbd PATCH v2 12/23] ci: Change docker driver and archive logs

Martin Kletzander mkletzan at redhat.com
Thu Jun 10 23:12:16 UTC 2021


Logs are by default kept for 1 week, and when we output them directly, we
sometimes exceed the limit for the job.  This also makes the output cleaner.

Docker driver overlayfs2 should be faster for docker dind builds.

Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
---
 .gitlab-ci.yml     | 30 ++++++++++++++++--------------
 ci/build_script.sh |  7 +------
 2 files changed, 17 insertions(+), 20 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 07d81ca779df..74807381b8ee 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,5 +1,6 @@
 variables:
   GIT_DEPTH: 100
+  DOCKER_DRIVER: overlay2
 
 stages:
   - containers
@@ -32,9 +33,8 @@ stages:
   after_script:
     - docker logout
 
-.native_build_job:
+.base_build_job:
   stage: builds
-  image: $CI_REGISTRY_IMAGE/$NAME:latest
   cache:
     paths:
       - ccache/
@@ -43,6 +43,20 @@ stages:
     - *script_variables
   script:
     - ci/build_script.sh
+  artifacts:
+    paths:
+      - "config.log"
+      - "**/test-suite.log"
+    public: true
+    when: always
+
+.native_build_job:
+  extends: .base_build_job
+  image: $CI_REGISTRY_IMAGE/$NAME:latest
+
+.cross_build_job:
+  extends: .base_build_job
+  image: $CI_REGISTRY_IMAGE/$NAME-cross-$CROSS:latest
 
 # Jobs that we delegate to Cirrus CI because they require an operating
 # system other than Linux. These jobs will only run if the required
@@ -83,18 +97,6 @@ stages:
   rules:
     - if: "$CIRRUS_GITHUB_REPO && $CIRRUS_API_TOKEN"
 
-.cross_build_job:
-  stage: builds
-  image: $CI_REGISTRY_IMAGE/$NAME-cross-$CROSS:latest
-  cache:
-    paths:
-      - ccache/
-    key: "$CI_JOB_NAME"
-  before_script:
-    - *script_variables
-  script:
-    - ci/build_script.sh
-
 # Native container build jobs
 
 x64-centos-8-container:
diff --git a/ci/build_script.sh b/ci/build_script.sh
index ae236640449f..8e2cb5b986ca 100755
--- a/ci/build_script.sh
+++ b/ci/build_script.sh
@@ -29,12 +29,7 @@ main() {
        return 0
     fi
 
-    if ! $MAKE check
-    then
-        find . -name test-suite.log -exec grep -l '^X\?FAIL:' '{}' \+ | \
-            xargs cat
-        exit 1
-    fi
+    $MAKE check
 
     if test "$CHECK_VALGRIND" = "force"
     then
-- 
2.32.0




More information about the Libguestfs mailing list