meta data for this page
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| git:gitlab:ci:yaml:rules [2024/01/18 12:40] – created niziak | git:gitlab:ci:yaml:rules [2025/01/03 14:06] (current) – niziak | ||
|---|---|---|---|
| Line 12: | Line 12: | ||
| [[https:// | [[https:// | ||
| + | |||
| + | ===== conditional variables ===== | ||
| + | |||
| + | <code yaml> | ||
| + | build: | ||
| + | rules: | ||
| + | - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH | ||
| + | variables: | ||
| + | CCACHE_DISABLE: | ||
| + | - if: $CI_COMMIT_TAG | ||
| + | variables: | ||
| + | CCACHE_DISABLE: | ||
| + | </ | ||
| + | |||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | |||
| + | |||
| + | <code yaml> | ||
| + | workflow: | ||
| + | rules: | ||
| + | - if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH | ||
| + | variables: | ||
| + | CCACHE_DISABLE: | ||
| + | CACHE_CCACHE_POLICY: | ||
| + | - if: $CI_COMMIT_TAG | ||
| + | variables: | ||
| + | CCACHE_DISABLE: | ||
| + | CACHE_CCACHE_POLICY: | ||
| + | - when: always | ||
| + | |||
| + | .ccache: & | ||
| + | key: cache-ccache | ||
| + | paths: | ||
| + | - .ccache | ||
| + | policy: ${CACHE_CCACHE_POLICY} | ||
| + | |||
| + | |||
| + | .build-target: | ||
| + | cache: | ||
| + | - <<: *cache-ccache | ||
| + | |||
| + | </ | ||
| + | |||
| + | ===== negate glob? ===== | ||
| How to negate '' | How to negate '' | ||
| Line 17: | Line 62: | ||
| Not possible. '' | Not possible. '' | ||
| You have to specify all paths/ | You have to specify all paths/ | ||
| + | |||
| + | BUT: | ||
| Glob patterns are interpreted with Ruby’s [[https:// | Glob patterns are interpreted with Ruby’s [[https:// | ||
| - | Ruby's fnmatch is used to handle patterns. It doesn' | + | Ruby's fnmatch is used to handle patterns. It doesn' |
| + | |||
| + | To write rule to do not match changes in < | ||
| + | <code yaml> | ||
| + | rules: | ||
| + | - changes: | ||
| + | - "{[^s]*,s,s[^r]*, | ||
| + | - " | ||
| + | </ | ||
| + | |||
| + | Note: second pattern '' | ||
| + | More, to exclude '' | ||
| - | [[https://stackoverflow.com/questions/ | + | <code yaml> |
| + | rules: | ||
| + | - changes: | ||
| + | - "{[^s^d]*, | ||
| + | - " | ||
| + | </code> | ||
| + | More about: | ||
| + | * [[https:// | ||
| + | * [[https:// | ||