[libvirt PATCH 19/20] gitlab-ci.yml: Adopt job execution via a Bash script

Erik Skultety eskultet at redhat.com
Mon Feb 6 13:53:16 UTC 2023


Instead of open-coding the script steps like we've done until now, use
a shell script.

Signed-off-by: Erik Skultety <eskultet at redhat.com>
---
 .gitlab-ci.yml | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index abd7498058..747209dca9 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -26,14 +26,11 @@ include:
     key: "$CI_JOB_NAME"
   script:
     - *script_variables
-    - meson setup build --werror $MESON_ARGS || (cat build/meson-logs/meson-log.txt && exit 1)
-    - meson dist -C build --no-tests
     - if test -x /usr/bin/rpmbuild && test "$RPM" != "skip";
       then
-        rpmbuild --clean --nodeps --define "_without_mingw 1" -ta build/meson-dist/libvirt-*.tar.xz;
+         ci/build.sh --rpmbuild;
       else
-        meson compile -C build;
-        meson test -C build --no-suite syntax-check --print-errorlogs;
+         ci/build.sh --build --test;
       fi
   after_script:
     - test "$CI_JOB_STATUS" != "success" && exit 1;
@@ -41,6 +38,8 @@ include:
       then
         mv "$HOME"/rpmbuild/RPMS/x86_64/ libvirt-rpms/;
       fi
+  variables:
+    MESON_TEST_ARGS: --no-suite syntax-check --print-errorlogs
 
 .native_build_job_prebuilt_env:
   extends:
@@ -59,9 +58,14 @@ include:
     key: "$CI_JOB_NAME"
   script:
     - *script_variables
-    - meson setup build --werror $MESON_OPTS || (cat build/meson-logs/meson-log.txt && exit 1)
-    - meson compile -C build
-    - if test "$CROSS" = "i686" ; then meson test -C build --no-suite syntax-check --print-errorlogs ; fi
+    - ci/build.sh --build
+    - if test "$CROSS" = "i686" ;
+      then
+        ci/build.sh --test;
+      fi
+  variables:
+    MESON_TEST_ARGS: --no-suite syntax-check --print-errorlogs
+
 
 .cross_build_job_prebuilt_env:
   extends:
@@ -80,8 +84,7 @@ include:
 .website_job:
   script:
     - *script_variables
-    - meson setup build --werror -Dsystem=true || (cat build/meson-logs/meson-log.txt && exit 1)
-    - DESTDIR=$(pwd)/install meson compile -C build install-web
+    - ci/build.sh --website
   after_script:
     - test "$CI_JOB_STATUS" != "success" && exit 1;
     - mv install/usr/share/doc/libvirt/html/ website
@@ -116,9 +119,7 @@ website_local_env:
   stage: sanity_checks
   script:
     - *script_variables
-    - meson setup build --werror || (cat build/meson-logs/meson-log.txt && exit 1)
-    - meson compile -C build libvirt-pot-dep
-    - meson test -C build --suite syntax-check --no-rebuild --print-errorlogs
+    - ci/build.sh --codestyle
 
 codestyle_prebuilt_env:
   extends:
@@ -159,8 +160,7 @@ potfile:
   before_script:
     - *script_variables
   script:
-    - meson setup build --werror || (cat build/meson-logs/meson-log.txt && exit 1)
-    - meson compile -C build libvirt-pot-dep libvirt-pot
+    - ci/build.sh --potfile
   after_script:
     - test "$CI_JOB_STATUS" != "success" && exit 1;
     - cp po/libvirt.pot libvirt.pot
-- 
2.39.1



More information about the libvir-list mailing list