Skip to content

Commit 66fc3b2

Browse files
committed
Split release:deployment job so that release:deployment:tag will use artifacts from its own tag pipeline
1 parent b6f0926 commit 66fc3b2

File tree

1 file changed

+26
-31
lines changed

1 file changed

+26
-31
lines changed

.gitlab-ci.yml

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,8 @@ integration:prerelease:
380380
stage: integration
381381
needs:
382382
- integration:builds
383+
- job: build:prerelease
384+
optional: true
383385
- job: integration:nix
384386
optional: true
385387
- job: integration:docker
@@ -431,22 +433,16 @@ integration:prerelease:
431433
integration:merge:
432434
stage: integration
433435
needs:
434-
- job: build:merge
435-
artifacts: false
436+
- build:merge
436437
- job: integration:nix
437438
optional: true
438-
artifacts: false
439439
- job: integration:docker
440440
optional: true
441-
artifacts: false
442441
- job: integration:linux
443442
optional: true
444-
artifacts: false
445443
- job: integration:windows
446444
optional: true
447-
artifacts: false
448445
- job: integration:macos
449-
artifacts: false
450446
optional: true
451447
# Requires mutual exclusion
452448
resource_group: integration:merge
@@ -475,50 +471,49 @@ integration:merge:
475471
# Runs on tag pipeline where the tag is a prerelease or release version
476472
- if: $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
477473

478-
release:deployment:
474+
release:deployment:branch:
479475
stage: release
476+
# Only needs integration:builds from the staging branch pipeline
480477
needs:
481-
- job: integration:merge
482-
optional: true
483478
- project: $CI_PROJECT_PATH
484479
job: integration:builds
485480
ref: staging
486481
artifacts: true
487482
# Don't interrupt deploying job
488483
interruptible: false
489-
# Requires mutual exclusion
484+
# Requires mutual exclusion (also with release:deployment:tag)
490485
resource_group: release:deployment
491486
script:
492487
- echo 'Perform service deployment for production'
493488
rules:
494489
# Runs on master commits and ignores version commits
495490
- if: $CI_COMMIT_BRANCH == 'master' && $CI_COMMIT_TITLE !~ /^[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
491+
492+
release:deployment:tag:
493+
stage: release
494+
# Tag pipelines run independently
495+
needs:
496+
- integration:builds
497+
- integration:merge
498+
# Don't interrupt deploying job
499+
interruptible: false
500+
# Requires mutual exclusion (also with release:deployment:branch)
501+
resource_group: release:deployment
502+
script:
503+
- echo 'Perform service deployment for production'
504+
rules:
496505
# Runs on tag pipeline where the tag is a release version
497506
- if: $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/
498507

499508
release:distribution:
500509
stage: release
501510
needs:
502-
- job: integration:merge
503-
optional: true
504-
- job: release:deployment
505-
optional: true
506-
- project: $CI_PROJECT_PATH
507-
job: build:linux
508-
ref: staging
509-
artifacts: true
510-
- project: $CI_PROJECT_PATH
511-
job: build:windows
512-
ref: staging
513-
artifacts: true
514-
- project: $CI_PROJECT_PATH
515-
job: build:macos
516-
ref: staging
517-
artifacts: true
518-
- project: $CI_PROJECT_PATH
519-
job: integration:builds
520-
ref: staging
521-
artifacts: true
511+
- build:linux
512+
- build:windows
513+
- build:macos
514+
- integration:builds
515+
- integration:merge
516+
- release:deployment:tag
522517
# Don't interrupt publishing job
523518
interruptible: false
524519
before_script:

0 commit comments

Comments
 (0)