CI PowerShell variables do not resolve properly for cache keys
Summary
PowerShell CI variables e.g. $env:CI_BUILD_REF_NAME
are not resolved properly for cache keys.
(Same issue with new variables as well e.g. CI_COMMIT_REF_NAME
)
Steps to reproduce
- Use PowerShell as the shell executer
[[runners]]
name = "windows-01"
url = ""
token = ""
executor = "shell"
shell = "powershell"
- Set global cache using
$env:CI_BUILD_REF_NAME
as cache key
cache:
key: "$env:CI_BUILD_REF_NAME"
untracked: true
- Run build
Actual behavior
- Extracting cache
Checking cache for :CI_BUILD_REF_NAME...
FATAL: open ..\..\..\..\..\cache\engine\electron\:CI_BUILD_REF_NAME\cache.zip: The filename, directory name, or volume label syntax is incorrect.
Failed to extract cache
- Writing cache
WARNING: GetFileAttributesEx ..\..\..\..\..\cache\engine\electron\:CI_BUILD_REF_NAME\cache.zip: The filename, directory name, or volume label syntax is incorrect.
FATAL: open ..\..\..\..\..\cache\engine\electron\:CI_BUILD_REF_NAME\archive_025139343: The filename, directory name, or volume label syntax is incorrect.
Failed to create cache
Expected behavior
- Extracting cache
Checking cache for master...
Successfully extracted cache
- Writing cache
Creating cache master...
...
Created cache
Job succeeded
Relevant logs and/or screenshots
Added in sections above
Environment description
- Custom Gitlab installation
-
gitlab-runner
on Microsoft Windows Server 2016 Standard
Used GitLab Runner version
Version: 9.5.0
Git revision: 413da38
Git branch: 9-5-stable
GO version: go1.8.3
Built: Tue, 22 Aug 2017 13:40:42 +0000
OS/Arch: windows/amd64