Skip to content
代码片段 群组 项目
提交 f32c59e4 编辑于 作者: Evan Read's avatar Evan Read
浏览文件

Merge branch 'harsimarsandhu-extends-keyword-compliance-pipeline-docs-update' into 'master'

Update compliance framework pipeline docs

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/117272



Merged-by: default avatarEvan Read <eread@gitlab.com>
Approved-by: default avatarEvan Read <eread@gitlab.com>
Reviewed-by: default avatarEvan Read <eread@gitlab.com>
Co-authored-by: default avatarharsimarsandhu <hsandhu@gitlab.com>
No related branches found
No related tags found
无相关合并请求
...@@ -347,3 +347,53 @@ mutation { ...@@ -347,3 +347,53 @@ mutation {
} }
} }
``` ```
### Compliance jobs are overwritten by target repository
If you use the `extends` statement in a compliance pipeline configuration, compliance jobs are overwritten by the target repository job. For example,
you could have the following `.compliance-gitlab-ci.yml` configuration:
```yaml
"compliance job":
extends:
- .compliance_template
stage: build
.compliance_template:
script:
- echo "take compliance action"
```
You could also have the following `.gitlab-ci.yml` configuration:
```yaml
"compliance job":
stage: test
script:
- echo "overwriting compliance action"
```
This configuration results in the target repository pipeline overwriting the compliance pipeline, and you get the following message:
`overwriting compliance action`.
To avoid overwriting a compliance job, don't use the `extends` keyword in compliance pipeline configuration. For example,
you could have the following `.compliance-gitlab-ci.yml` configuration:
```yaml
"compliance job":
stage: build
script:
- echo "take compliance action"
```
You could also have the following `.gitlab-ci.yml` configuration:
```yaml
"compliance job":
stage: test
script:
- echo "overwriting compliance action"
```
This configuration doesn't overwrite the compliance pipeline and you get the following message:
`take compliance action`.
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册