A naive question about the conceptional difference between following two alternatives for .gitlab-ci.yml file setting up a CI job of a GitLab project. Firstly, the runner configuration file config.toml file is configured as follows in order to have shell as executor:
[[runners]]
name = "TestRunner"
url = Blabla.com
token = xxxxxxxxxxxxxx
executor = "shell"
shell = "powershell"
Now the question is what is systematically the difference between the job task
stages:
- StageA
testjob:
stage: StageA
script:
- echo %AGlobalVar% \\some global variable, eg PATH
- mkdir blabla
tags:
- TestRunner
vs if I replace the “script” part by
script:
- cmd /c echo %AGlobalVar%
- cmd /c mkdir blabla
The job is intended to run on windows as local machine, shell is choosen as executor and as shell parameter “powershell”, (…or can also be choosen to be “pwsh” or “bash” (if available)). What is the systematical difference between if I invoke shell commandos “directly” (like in first version), or if I “wrap” them via detour through cmd command as in second version?
As partial question, in which sense GitLab “not sees” cmd.exe as a shell object itself but just a command of the shell, as “cmd” option for shell parameter is not available? Conceptionally, what is the difference from viewpoint of GitLab philosophy?