我已经阅读了gitlab的使用CI/CD变量定义人工名称文档和示例。
在我的 .gitlab-ci.yml
文件的以下摘录中,我尝试复制他们的powerShell示例:
artifacts:
name: "$env:CI_JOB_STAGE-$env:CI_COMMIT_REF_NAME"
expire_in: 1 week
paths:
- My\Hardcoded\Path\*
但是当我下载文物时,它命名为: _env_ci_job_stage-_env_env_env_env_ci_ci_ci_ci_cimit_ref_ref_ref_ref_name.zip
。我想在我的工件路径上使用变量,但这也不起作用,因此我被迫进行了铁码。我在做什么错?
我熟悉开放的gitlab问题:,我最终想放一个日期&文物名称中的时间戳,但首先我想获得任何可变工作。
我正在使用gitlab v15.1.1-ee。我的跑步者是v15.1.1,安装在Windows中,并在PowerShell中使用Shell Executor。
I have read GitLab's Use CI/CD Variables to Define Artifact Name documentation and examples.
In the following excerpt of my .gitlab-ci.yml
file, I try to replicate their powershell example:
artifacts:
name: "$env:CI_JOB_STAGE-$env:CI_COMMIT_REF_NAME"
expire_in: 1 week
paths:
- My\Hardcoded\Path\*
But when I download the artifact, it's named: _env_CI_JOB_STAGE-_env_CI_COMMIT_REF_NAME.zip
. I wanted to use a variable for my artifact path, but that didn't work either, so I was forced to hardcode it. What am I doing wrong?
I'm familiar with the open GitLab issue: Artifacts Filename Cannot Be Set with Dynamic Variables, and I would eventually like to put a date & timestamp in the artifact name, but first I'd just like to get any variable working.
I'm using GitLab v15.1.1-ee. My runner is v15.1.1, installed in Windows and uses a shell executor in powershell.
发布评论
评论(1)
per ,看来这是一个影响的错误v15.1.1。今天,我注意到我们的gitlab实例已升级到v15.1.2-ee,然后用v15.1.0替换了跑步者。现在,这些变量可以记录下来。
Per Ville Laurikari's comment, it appears this was a bug affecting v15.1.1. Today, I noticed that our GitLab instance was upgraded to v15.1.2-ee, and I replaced my runner with v15.1.0. The variables now work as documented.