Enable PowerShell Core support in Docker Executor on Linux
What does this MR do?
This MR builds on !2641 (merged) and adds support for Powershell Core (pwsh
shell) to the docker
executor (it already was supported on the docker-windows
executor).
It adds some tests for the Powershell
shell which were missing so that we now can test some of the added functionality (like the PassFile
expectations).
Why was this MR needed?
See #4021 (closed)
What's the best way to test this MR?
-
Build the helper image and the runner:
make helper-dockerarchive-host runner-bin-host
-
Register a runner (define $YOUR_TOKEN):
gitlab-runner register --non-interactive \ --executor "docker" \ --shell "pwsh" \ --docker-image "mcr.microsoft.com/powershell:preview-alpine-3.11" \ --url "https://gitlab.com/" \ --description "pwsh-docker-runner" \ --tag-list "pwsh,docker" \ --locked="false" \ --access-level="not_protected" \ --registration-token="$YOUR_TOKEN"
-
Create a project with the following job (example):
start_evaluation: script: - Write-Output $PSVersionTable tags: - docker - pwsh
-
Start the runner:
gitlab-runner run
The resulting job should look similar to this one. An early build with trace disabled allows us to see the Powershell scripts being sent to the helper container.
What are the relevant issue numbers?
Edited by Georgi N. Georgiev