Skip to content

Powershell Project Secret Variable Substitution

Using gitlab-runner (11.9 win64 bit) configured with executor = "shell" and shell = "powershell" and a gitl-ci.config containing

 script: 
   - $time = Get-Date -f yyyy-MM-dd-HH-mm
   - D:\\qislsf\\apache-ant-1.10.5\\bin\\ant.bat -DJVM_VAR=$env:SECRET_VAR > D:\\log\\build_$time.log

I don't understand why D:\\ant\\ant.bat -DJVM_VAR=$env:SECRET_VAR is not substituted, whereas D:\\ant\\ant.bat -DJVM_VAR=$SECRET_VAR$ is processed as expected.

According to https://docs.gitlab.com/ee/ci/variables/, I would rather expect that "$env:SECRET_VAR" would be suffcient?

Solution with what GitLab documentation should be updated with

#4115 (comment 157692820)

Edited by Steve Xuereb