We are running Gitlab 16.3.4 in a Kubernetes cluster. Runners are configured to spawn new ones if I understand it correctly.
This is my .gitlab-ci.yml:
stages:
- run
run:
stage: run
image: mcr.microsoft.com/windows/servercore:ltsc2022
tags:
- windows
script:
- this should fail because it does not exist
- Write-Host "hello world"
Clearly the first script command fails. The second command will not be executed but the status of the job itself is “succeeded”. I don’t get why.
This is the pipeline log:
Skipping Git submodules setup
Executing "step_script" stage of the job script
$ this should fail because it does not exist
powershell : this : The term 'this' is not recognized as the name of a cmdlet,
function,
At C:\scripts-295-33766\terminate_with_json_script.ps1:7 char:1
+ powershell -File $Path
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (this : The term...let, function,
:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
script file, or operable program. Check the spelling of the name, or if a path
was included, verify that the path is correct and try again.
At C:\scripts-295-33766\step_script.ps1:259 char:1
+ this should fail because it does not exist
+ ~~~~
+ CategoryInfo : ObjectNotFound: (this:String) [], CommandNotFoun
dException
+ FullyQualifiedErrorId : CommandNotFoundException
Cleaning up project directory and file based variables
Job succeeded
Any ideas?