ci_template: make sure powershell hard exists on errors
authorJordan Petridis <jordan@centricular.com>
Wed, 4 Dec 2019 22:52:45 +0000 (00:52 +0200)
committerJordan Petridis <jordan@centricular.com>
Wed, 4 Dec 2019 22:59:34 +0000 (00:59 +0200)
We set the env var as the shell of the image, but looks like
the gitlab runner is overriding that.

docker/windows/Dockerfile
gitlab/ci_template.yml

index e843060..913b197 100644 (file)
@@ -4,6 +4,7 @@ FROM 'mcr.microsoft.com/windows/servercore:1809'
 
 # Make sure any failure in PowerShell scripts is fatal
 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]
+ENV ErrorActionPreference='Stop'
 
 COPY install_toolchain.ps1 prepare_gst_env.ps1 C:\
 
index 7466700..e846c61 100644 (file)
@@ -421,6 +421,10 @@ valgrind ges:
       -Dvaapi=disabled
       -Ddevtools=disabled
   script:
+    # Make sure powershell exists on errors
+    # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-6
+    - $ErrorActionPreference = "Stop"
+
     - git clone https://gitlab.freedesktop.org/gstreamer/gst-build.git $env:CI_PROJECT_DIR/gst-build
     - cd $env:CI_PROJECT_DIR/gst-build
     - cp -r C:/subprojects/* subprojects/
@@ -464,6 +468,10 @@ build vs2017 x86:
 build msys2 :
   extends: '.build windows'
   script:
+    # Make sure powershell exists on errors
+    # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-6
+    - $ErrorActionPreference = "Stop"
+
     # For some reason docker build hangs if this is included in the image, needs more troubleshooting
     - $env:PATH += ';C:\msys64\usr\bin;C:\msys64\mingw64\bin;C:\msys64\mingw32\bin'
     - C:\msys64\usr\bin\bash -c "pacman-key --init && pacman-key --populate msys2 && pacman-key --refresh-keys || true"