After some initial problems I was finally able to set up a self-hosted GitLab Runner on my personal laptop.
I'm now looking into how this runner works and how I can tweak it's environment to my needs. I modified the YML file to run a simple command echoing the PATH environment variable:
stages: # List of stages for jobs, and their order of execution
- run
deploy-job:
stage: run
script:
- echo $env:path.split(";")
When I commit and push this up to GitLab, the pipeline displays the following environment:
C:\Program Files (x86)\Common Files\Oracle\Java\javapath
C:\Users\921479\AppData\Local\Programs\Python\Python39\Scripts\
C:\Users\921479\AppData\Local\Programs\Python\Python39\
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0\
C:\Windows\System32\OpenSSH\
C:\ProgramData\chocolatey\bin
C:\Users\921479\AppData\Local\SumatraPDF
C:\texlive\2021\bin\win32
C:\Program Files (x86)\PDFtk Server\bin\
C:\Program Files (x86)\Lua\5.1
C:\Program Files (x86)\Lua\5.1\clibs
C:\Program Files\Inkscape\bin
C:\Program Files\dotnet\
C:\Program Files\WindowsPowerShell\Scripts
C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\
C:\Program Files (x86)\dotnet\
C:\Program Files (x86)\glab
C:\Program Files\Git\cmd
C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps
C:\Program Files\Oracle\VirtualBox
C:\Program Files (x86)\Oracle\VirtualBox
I then ran the exact same command from a regular powershell terminal on the runner host (i.e. my local machine), and got the following:
C:\Users\921479\Miniconda3\envs\temp
C:\Users\921479\Miniconda3\envs\temp\Library\mingw-w64\bin
C:\Users\921479\Miniconda3\envs\temp\Library\usr\bin
C:\Users\921479\Miniconda3\envs\temp\Library\bin
C:\Users\921479\Miniconda3\envs\temp\Scripts
C:\Users\921479\Miniconda3\envs\temp\bin
C:\Users\921479\Miniconda3\condabin
C:\Program Files (x86)\Common Files\Oracle\Java\javapath
C:\Users\921479\AppData\Local\Programs\Python\Python39\Scripts
C:\Users\921479\AppData\Local\Programs\Python\Python39
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0
C:\Windows\System32\OpenSSH
C:\ProgramData\chocolatey\bin
C:\Users\921479\AppData\Local\SumatraPDF
C:\texlive\2021\bin\win32
C:\Program Files (x86)\PDFtk Server\bin
C:\Program Files (x86)\Lua\5.1
C:\Program Files (x86)\Lua\5.1\clibs
C:\Program Files\Inkscape\bin
C:\Program Files\dotnet
C:\Program Files\WindowsPowerShell\Scripts
C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit
C:\Program Files (x86)\dotnet
C:\Program Files (x86)\glab
C:\Program Files\Git\cmd
C:\Users\921479\AppData\Local\Microsoft\WindowsApps
C:\Users\921479\.dotnet\tools
C:\Program Files\Tracker Software\PDF Editor
C:\context\tex\texmf-win64\bin
C:\Program Files (x86)\Symantec\Symantec Endpoint Protection
C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64
C:\Users\921479\handle
C:\Program Files\Google\Chrome\Application
C:\Users\921479\AppData\Local\Pandoc
I'm a bit surprised that the paths are different, considering my runner is my local machine with a Powershell shell executor in the config.toml.
Why does PATH in the Runner and PATH from a regular Powershell environment have different contents?