2

我正在尝试 gitlab 管道。现在我做了一些更改并推送到主分支管道中的代码显示已经更新到最新但我的代码有更改 在此处输入图像描述

我尝试引入三个阶段但仍然是相同的问题 .gitlab-ci.yml

before_script:
  - echo "Before script"
building:
  stage: build
  script:
    - git pull origin master
testing:
  stage: test
  script:
    - git pull origin master
deploying:
  stage: deploy
  script:
    - git pull origin master
4

2 回答 2

0

如果 gitlab-ci 工作流程从克隆您的存储库开始,那么任何 git pull 都不会改变您已经拥有完整历史记录的事实,并且在工作流程时,这“已经是最新的”。

换句话说,您的gitlab-ci.yml文件中不需要 git pull。

于 2021-07-15T06:44:46.700 回答
0

如果您的管道在您更改的同一存储库上运行,则无需使用git pull. 虽然,如果您的管道触发(在 repo A 上)另一个存储库(repo B)上的另一个管道,要访问 repo A 中的文件,您必须将 repo A 拉到 repo B 管道中。

于 2021-09-22T07:42:16.423 回答