Gab*_*las 12 gitlab-ci gitlab-pipelines
commit/merge request如果我的管道中唯一的更改部分与文件相关,我需要跳过管道中的 GitLab CI 作业*.md, eslintrc.json or jsconfig.json。
例子:
我试图实现这一点,但到目前为止我还没有发现except:changes也没有用处。rules:when:never我该怎么做?
小智 3
如果我的理解是正确的,那么您需要except:changes在 CI 文件中进行约定。
看一下这个例子。如果 *.md、eslintrc.json 和 jsconfig.json 发生更改,作业会在任何情况下运行。在这种情况下,管道将不会运行。检查以下示例的except-changes阶段。
另一方面,您可以设置在任何js文件发生更改时运行管道。检查以下示例的 * only-changes* 阶段。
stages:
- except-changes
- only-changes
ignore-file-changes:
stage: except-changes
script:
- echo "Skip running the pipeline if *.md, eslintrc.json and jsconfig.json has any kind of change."
except:
changes:
- "**/*.md"
- eslintrc.json
- jsconfig.json
- README.md
pass-the-pipeline:
stage: only-changes
script:
- echo "Run only *.js and Dockerfile files has any kind of change."
only:
changes:
- Dockerfile
- "**/*.js"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7470 次 |
| 最近记录: |