无法将变量用于gitab-ci.yml中的伪影名。

发布于 2025-02-13 06:31:24 字数 868 浏览 1 评论 0 原文

我已经阅读了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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

莫相离 2025-02-20 06:31:24

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文