英文:
How to update GitLab CI/CD variables after repository name change?
问题
我最近在GitLab中更改了我的存储库名称。有没有办法确保库存的GitLab CI/CD变量更新以反映新的存储库名称,而不是在我的CI/CD管道中手动覆盖它们?
假设,原存储库名称为'A',新名称为'B'。一旦我更改了存储库的名称,由GitLab自动设置的GitLab CI/CD变量保持不变。例如,CI_PROJECT_NAME
变量仍然是A
,而我希望它现在是B
,以反映新的存储库名称。
英文:
I have recently changed my repository name in GitLab. Is there any way I can make sure that the stock GitLab CI/CD variables are updated to reflect the new repository name without manually overriding them in my CI/CD pipelines?
Hypothetically, lets say the repository's original name is 'A' and its new name is 'B'. Once I've changed the repository's name, the GitLab CI/CD variables that are set automatically by GitLab remain unchanged. For example the stock CI/CD variable CI_PROJECT_NAME
is still A
when I want it to now be B
to reflect the new repository name.
答案1
得分: 1
根据文档,变量CI_PROJECT_NAME
是从项目的目录派生的。这可以在设置
-> 常规
-> 高级
-> 更改路径
下进行更改。在此处编辑项目路径后,CI_PROJECT_NAME
的值会相应更改。
在您的情况下,我会猜测您只是在设置
-> 常规
-> 项目名称
下更改了项目名称,这仅用于在用户界面中显示。
英文:
According to the docs, the variable CI_PROJECT_NAME
is derived from the directory of the project. This can be changed under Settings
-> General
-> Avanced
-> Change path
. After editing the project path here, CI_PROJECT_NAME
changes its value accordingly.
In your case I would blindly guess that you just changed the project name
under Settings
-> General
-> Project name
, which is only used for displaying in the UI.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论