gitlab - 仅使用动态:更改 .gitlab-ci.yml 中的配置
问题描述
鉴于我有这样的存储库结构:
app-1
\_ conf
\_ app.properties
\_ secrets.properties
\_ some.properties
app-2
\_ conf
\_ app.properties
\_ secrets.properties
\_ some.properties
app-n
...
我想only:changes
用来定义是否应根据 Git 推送事件修改的文件创建作业:
app-1:
script:
- echo "Do stuff here"
only:
changes:
- app-1/**/*
refs:
- master
app-2:
script:
- echo "Do stuff here"
only:
changes:
- app-2/**/*
refs:
- master
app-n
...
但这很快就会变得不守规矩和重复。有没有办法对此进行模板化?IE:
job:
script:
- echo "Do stuff here"
only:
changes:
- $MAYBE_SOME_ENV_VAR_THAT_HAS_PATHS/**/*
refs:
- master
解决方案
推荐阅读
- json - 创建列表抛出列表
不是 Map 类型的子类型 - codeigniter - 如何在codeigniter表单验证中使用助手的回调?
- python - 熊猫没有丢弃或填充缺失值
- python-3.x - 各种版本的二元轮有什么区别?
- audio - Concat mp4 视频并将其音频合并到最终输出
- c# - C#统一命名空间'
' 已经包含一个定义 - ios - 带有标签、图像、gif 和视频的 TableView 在从 iOS、Swift 中的 firestore 获取时挂起/卡住不正确
- r - 如何将 csv 数据加载到 r 中?特别是没有文件?
- java - 为什么 Jacoco Coverage Report for Branches 说 if (a && b && c) 实际上是 6 个分支?
- python - Django 在序列化程序中无法识别我的自定义更新方法