Pipeline succeeds despite statements failing (Windows)
I'm on a Windows 10 VM created with Hyper-V Quick Create (Windows 10 Enterprise Evaluation 1809 17763.134). I just registered, installed, and started the runner. I started a pipeline without installing Git... oops! But, the pipeline succeeded?!
Running with gitlab-runner 11.9.2 (fa86510e)
on DESKTOP-VMN6K6H dFue64Cz
Using Shell executor...
Running on DESKTOP-VMN6K6H...
& : The term 'git' is not recognized as the name of a cmdlet, function, 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:\Windows\TEMP\build_script564211778\script.ps1:140 char:3
+ & "git" "config" "-f" "C:\gitlab-runner\builds\dFue64Cz\0\anthony.mas ...
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (git:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
cd : Cannot find path 'C:\gitlab-runner\builds\dFue64Cz\0\anthony.mastrean-vaeit\gitlab-runner-examples' because it
does not exist.
At C:\Windows\TEMP\build_script319302329\script.ps1:137 char:1
+ cd "C:\gitlab-runner\builds\dFue64Cz\0\anthony.mastrean-vaeit\gitlab- ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\gitlab-runne...runner-examples:String) [Set-Location], ItemNotFoundE
xception
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
cd : Cannot find path 'C:\gitlab-runner\builds\dFue64Cz\0\anthony.mastrean-vaeit\gitlab-runner-examples' because it
does not exist.
At C:\Windows\TEMP\build_script239605444\script.ps1:137 char:1
+ cd "C:\gitlab-runner\builds\dFue64Cz\0\anthony.mastrean-vaeit\gitlab- ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\gitlab-runne...runner-examples:String) [Set-Location], ItemNotFoundE
xception
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
cd : Cannot find path 'C:\gitlab-runner\builds\dFue64Cz\0\anthony.mastrean-vaeit\gitlab-runner-examples' because it
does not exist.
At C:\Windows\TEMP\build_script897439059\script.ps1:137 char:1
+ cd "C:\gitlab-runner\builds\dFue64Cz\0\anthony.mastrean-vaeit\gitlab- ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\gitlab-runne...runner-examples:String) [Set-Location], ItemNotFoundE
xception
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
cd : Cannot find path 'C:\gitlab-runner\builds\dFue64Cz\0\anthony.mastrean-vaeit\gitlab-runner-examples' because it
does not exist.
At C:\Windows\TEMP\build_script820974845\script.ps1:137 char:1
+ cd "C:\gitlab-runner\builds\dFue64Cz\0\anthony.mastrean-vaeit\gitlab- ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\gitlab-runne...runner-examples:String) [Set-Location], ItemNotFoundE
xception
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
cd : Cannot find path 'C:\gitlab-runner\builds\dFue64Cz\0\anthony.mastrean-vaeit\gitlab-runner-examples' because it
does not exist.
At C:\Windows\TEMP\build_script962742840\script.ps1:137 char:1
+ cd "C:\gitlab-runner\builds\dFue64Cz\0\anthony.mastrean-vaeit\gitlab- ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\gitlab-runne...runner-examples:String) [Set-Location], ItemNotFoundE
xception
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
Job succeeded
OK, wait, it gets worse. Here's a build script where a statement fails and it stops execution, but it still reports success?!
.gitlab-ci.yml
build:
stage: build
script:
- $CI_PROJECT_DIR
- Get-Variable $CI_PROJECT_DIR
- $ENV:CI_PROJECT_DIR
- Get-Variable $ENV:CI_PROJECT_DIR
Running with gitlab-runner 11.11.0~beta.1345.g56fcfdba (56fcfdba)
on DESKTOP-VMN6K6H dFue64Cz
Using Shell executor...
Running on DESKTOP-VMN6K6H...
Reinitialized existing Git repository in C:/gitlab-runner/builds/dFue64Cz/0/anthony.mastrean-vaeit/gitlab-runner-examples/.git/
Fetching changes...
From https://gitlab.com/anthony.mastrean-vaeit/gitlab-runner-examples
6a5b05c..4f2e451 master -> origin/master
Checking out 4f2e4515 as master...
git-lfs/2.7.1 (GitHub; windows amd64; go 1.11.5; git 6b7fb6e3)
Skipping object checkout, Git LFS is not installed.
Skipping Git submodules setup
$ Get-Variable $CI_PROJECT_DIR
Get-Variable : Cannot find a variable with the name
'C:\gitlab-runner\builds\dFue64Cz\0\anthony.mastrean-vaeit\gitlab-runner-examples'.
At C:\Windows\TEMP\build_script031705439\script.ps1:151 char:1
+ Get-Variable $CI_PROJECT_DIR
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\gitlab-runne...runner-examples:String) [Get-Variable], ItemNotFoundE
xception
+ FullyQualifiedErrorId : VariableNotFound,Microsoft.PowerShell.Commands.GetVariableCommand
Job succeeded
Edited by 🤖 GitLab Bot 🤖