From 5c0ad2facdfc418c7af640ecf6eb4449d3f6b04f Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Thu, 5 Dec 2019 00:52:45 +0200 Subject: [PATCH] ci_template: make sure powershell hard exists on errors We set the env var as the shell of the image, but looks like the gitlab runner is overriding that. --- docker/windows/Dockerfile | 1 + gitlab/ci_template.yml | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/docker/windows/Dockerfile b/docker/windows/Dockerfile index e8430606a9..913b19732b 100644 --- a/docker/windows/Dockerfile +++ b/docker/windows/Dockerfile @@ -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:\ diff --git a/gitlab/ci_template.yml b/gitlab/ci_template.yml index 7466700422..e846c6169a 100644 --- a/gitlab/ci_template.yml +++ b/gitlab/ci_template.yml @@ -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"