2222# =============================================================================
2323
2424include :
25- - local : ' .gitlab/ci/generate.yml' # .fetch_targets and . generate_pipeline templates
25+ - local : ' .gitlab/ci/generate.yml' # .generate_pipeline template
2626 - local : ' .gitlab/ci/flyway.yml' # Flyway templates (used by child pipeline)
2727
2828stages :
29- - fetch
3029 - generate
3130 - deploy
3231
@@ -43,37 +42,20 @@ variables:
4342 # Registry connection (set sensitive values in GitLab CI/CD Variables)
4443 REGISTRY_DATABASE : " flyway_registry"
4544 REGISTRY_PORT : " 1433"
46- SQL_SERVER_PORT : " 1433"
47-
48- # Set to "0" to target primary databases only (skip replicas)
49- INCLUDE_REPLICAS : " 1"
50-
51- # ---------------------------------------------------------------------------
52- # Stage 1 – fetch: query the registry, write targets.json artifact
53- # ---------------------------------------------------------------------------
54- fetch:all-regions :
55- extends : .fetch_targets
56- variables :
57- FILTER_LOCATION : " all"
58- only :
59- - main
60- - tags
6145
6246# ---------------------------------------------------------------------------
63- # Stage 2 – generate: read targets.json, write dynamic-pipeline.yml artifact
64- # No database connection required at this stage.
47+ # Stage 1 – generate: query registry, build JDBCs, write dynamic-pipeline.yml
6548# ---------------------------------------------------------------------------
6649generate:all-regions :
6750 extends : .generate_pipeline
68- needs :
69- - job : fetch:all-regions
70- artifacts : true
71- only :
72- - main
73- - tags
51+ variables :
52+ FILTER_LOCATION : " all"
53+ rules :
54+ - if : $CI_COMMIT_BRANCH == "main"
55+ - if : $CI_COMMIT_TAG
7456
7557# ---------------------------------------------------------------------------
76- # Stage 3 – deploy: trigger the generated child pipeline
58+ # Stage 2 – deploy: trigger the generated child pipeline
7759# strategy: depend → parent waits for all child jobs to finish
7860# ---------------------------------------------------------------------------
7961deploy:all-regions :
@@ -83,6 +65,6 @@ deploy:all-regions:
8365 - artifact : dynamic-pipeline.yml
8466 job : generate:all-regions
8567 strategy : depend
86- only :
87- - main
88- - tags
68+ rules :
69+ - if : $CI_COMMIT_BRANCH == " main"
70+ - if : $CI_COMMIT_TAG
0 commit comments