feat(gitlab-sim): 🚀 branches support

This commit is contained in:
2026-06-07 23:13:52 +02:00
parent ff0d9b51f3
commit f98e9c42e7
9 changed files with 997 additions and 3 deletions
+58
View File
@@ -0,0 +1,58 @@
# context_rules.yml
# Pipeline exercising context-aware rules evaluation.
# Expected behaviour per context:
# (no context) → lints clean, all jobs visible
# --branch main → build, test, deploy-prod active; deploy-staging/release-notes skipped
# --branch develop → build, test, deploy-staging active; deploy-prod/release-notes skipped
# --branch feat/my-feat → build, test active; deploy-staging manual; deploy-prod/release-notes skipped
# --tag v1.0.0 → build, test, deploy-prod, release-notes active; deploy-staging skipped
stages:
- build
- test
- deploy
build:
stage: build
script:
- make build
rules:
- when: always
test:
stage: test
script:
- make test
rules:
- when: always
deploy-staging:
stage: deploy
script:
- make deploy ENV=staging
rules:
- if: $CI_COMMIT_BRANCH == "develop"
when: on_success
- if: $CI_COMMIT_BRANCH =~ /^feat\//
when: manual
- when: never
deploy-prod:
stage: deploy
script:
- make deploy ENV=production
rules:
- if: $CI_COMMIT_BRANCH == "main"
when: on_success
- if: $CI_COMMIT_TAG != null
when: on_success
- when: never
release-notes:
stage: deploy
script:
- make release
rules:
- if: $CI_COMMIT_TAG != null
when: on_success
- when: never