gpt4 book ai didi

gitlab - 如何使用标签设置作业工件永不过期 Gitlab CI

转载 作者:行者123 更新时间:2023-12-04 12:39:01 30 4
gpt4 key购买 nike

我想知道是否有可能将生成工件的作业设置为永不过期,如果提交带有标签,否则它应该过期。目前,它在全局范围内设置为 3 天后到期。但我想要一些类似的东西,如果提交是用特定的 tag 完成的它运行一个 Job A它会生成工件,那么它应该永远不会过期。但同样Job A应该为没有标签的其他提交运行,并且为此生成的工件应该在全局设置的时间内过期。

最佳答案

GitLab 13.3 (2020 年 8 月),这是官方支持的
(与“解决方法”相反,使用 expire_in 5 years !)

Configure a job artifact to never expire

As a developer, you have the ability to specify a job artifact’s exact expiration date, but there are scenarios where you may need to retain an artifact forever.

Now, you can set an artifact to never expire by setting the value of expire_in to never in your CI configuration.

See Documentation and Issue.



OP澄清:

I have one job which runs for every commit and the artifacts for this jobs expires in three days but for the same job if there is a commit with tag I want the artifacts to be kept forever.



注: GitLab 13.4 (2020 年 9 月)添加了一个有趣的功能:

Lock the latest job artifact to prevent deletion

GitLab will now automatically lock the latest artifact of a successful job and pipeline on any active branch, MR, or tag to prevent it from being deleted based on expiration. This makes it easier to set a more aggressive expiration policy to clean up older artifacts, helps reduce disk space consumption, and ensures you’ve always got a copy of the latest artifact from your pipeline.

See Documentation and Issue.

关于gitlab - 如何使用标签设置作业工件永不过期 Gitlab CI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61439826/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com