假设我们在GitLab上有两个项目A和B,我希望有一条规则允许项目B中定义的下游作业只在项目A中的触发器触发时才运行。
项目A gitlab-ci.yml:
stages:
- build
build_container:
stage: build
trigger:
project: B
项目B gitlab-ci.yml:
build:
stages:
- build
rules: only run this job when it's triggered by project A
script: commands to build som
在我的例子中,只有当作业smoke-test圆满完成时,我才想运行作业deploy。有一个关键字,它应该能做到这一点。
然而,在docs中也有这样的文字:
In GitLab 13.9 and older, if needs: refers to a job that might not be added to a pipeline because of only, except, or rules, the pipeline might fail to create.
这正是我的情况(管道甚至没有启动,因为deploy作业不存在)。deploy作业是有条件的,使用非常复杂的rules条件:
我将作业设置为只在将作业推送/合并到分支"dev“时才能运行,但我也希望这样做,因此如果手动触发该管道,我就能够运行它们。就像这样:
test:
stage: test
<this step should be run always>
build:
stage: build
rules:
- if: $CI_COMMIT_REF_NAME == "dev"
- if: <also run if the pipeline was run manually, but skip if it was triggered by
我想自动将gitlab管道的测试结果(基本上是一个xml文件)加载到我的项目管理应用程序中。这两者之间不可能有直接联系。然而,gitlab API提供了以下下载管道工件的选项:
最新成功管道运行的所有工件(按作业名称选择)
/projects/:id/jobs/artifacts/:ref_name/download?job=name` GET
特定作业的所有工件(按作业id选择)
GET /projects/:id/作业/:job_id/工件
单个工件文件(按作业id选择)
/projects/:id/jobs/:job_id/artifacts/*artifact_path GE
我在GitLab中有一个可分析的项目,通过GitLab CI Runner按计划运行playbook。
我想把playbook的执行从runner移动到AWX (Ansible to )。AWX支持在GitLab中通过webhook触发作业模板,但在GitLab中我找不到一种通过调度触发webhook的方法。
有没有办法在GitLab CI中按计划触发webhhok?
我正在使用,我希望运行CI作业,以避免为每个作业提取图像所需的额外分钟。试图在..gitlab ci.yml文件中设置该值会给出以下错误:
pull_policy ([if-not-present]) defined in GitLab pipeline config is not one of the allowed_pull_policies ([always])
这就引出了的设置,因此我在存储库的根目录创建了一个config.toml文件,并进行了尝试。然而,我仍然会遇到同样的错误。
config.toml是否仅适用于手动/自托管运行程序?还有别的办法可以克服这一切吗?
上下文
..g
我有一个很长的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)
-