Skip to content

Enable PowerShell Core support in Docker Executor on Linux

Pedro Pombeiro requested to merge 4021-pwsh-on-linux-docker into master

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?

  1. Build the helper image and the runner:

    make helper-dockerarchive-host runner-bin-host
  2. 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"
  3. Create a project with the following job (example):

    start_evaluation:
      script:
        - Write-Output $PSVersionTable
      tags:
        - docker
        - pwsh
  4. 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?

Closes #4021 (closed) #2547 (closed) #27438 (closed)

Edited by Georgi N. Georgiev

Merge request reports

Loading