gitlab-ci: Move scons build/test commands to a separate shell script
authorMichel Dänzer <mdaenzer@redhat.com>
Thu, 12 Sep 2019 09:34:43 +0000 (11:34 +0200)
committerMichel Dänzer <michel@daenzer.net>
Wed, 18 Sep 2019 10:36:48 +0000 (10:36 +0000)
Preparatory, no functional change intended.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
.gitlab-ci.yml
.gitlab-ci/scons-build.sh [new file with mode: 0755]

index bada20d..170b2cb 100644 (file)
@@ -129,11 +129,7 @@ test-container:arm64:
   variables:
     SCONSFLAGS: "-j4"
   script:
-    - if test -n "$LLVM_VERSION"; then
-        export LLVM_CONFIG="llvm-config-${LLVM_VERSION}";
-      fi
-    - scons $SCONS_TARGET
-    - eval $SCONS_CHECK_COMMAND
+    - .gitlab-ci/scons-build.sh
 
 meson-main:
   extends:
diff --git a/.gitlab-ci/scons-build.sh b/.gitlab-ci/scons-build.sh
new file mode 100755 (executable)
index 0000000..30e93c2
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+set -e
+set -o xtrace
+
+if test -n "$LLVM_VERSION"; then
+    export LLVM_CONFIG="llvm-config-${LLVM_VERSION}"
+fi
+
+rm -rf build
+scons $SCONS_TARGET
+eval $SCONS_CHECK_COMMAND