我有一个很长的gitlab CI,是一种单声道存储库的结构。如下所示: Project A
--- .gitlab-ci.yaml (contains thousands of jobs across 3 stages(plan, test and apply) and also includes gitlab-ci folder)
--- gitlab-ci/my-ci.yaml (folder than contains specific ci files, this has 2 stages, plan and apply for my-new-code)
-
当.gitlab-ci.yml仅在合并请求中运行时,如何正确写入作业?
test_c:
stage: test
script:
- echo "This job tests something. It will only run when all jobs in the"
- echo "build stage are complete."
only:
- merge_requests
此作业未在合并请求中运行,但未在master或develop中的commint中运行。
我们正在努力开发一个GitLab ci管道。我们有三个作业: A、B和C。我们只想在执行A或B时才执行C作业。
如何定义这样的工作C?
我尝试过使用needs,但由于没有执行所需的作业,它会产生错误:
Found errors in your .gitlab-ci.yml:
'C' job needs 'A' job, but 'A' is not in any previous stage.
'C' job needs 'B' job, but 'B' is not in any previous
我使用GitLab Runner在AWS EC2 spot实例上运行CI作业,使用其对Docker的自动标度功能。
突然之间,GitLab CI未能运行作业,并向我展示了我想要启动的所有作业的以下作业输出:
Running with gitlab-runner 14.9.1 (f188edd7)
on AWS EC2 runner ...
Preparing the "docker+machine" executor
10:05
ERROR: Preparation failed: exit status 1
Will be retried in 3s ...
ERROR: