Skip to content

Commit abdc55e

Browse files
committed
Split release:deployment job so that release:deployment:tag will use artifacts from its own tag pipeline
1 parent 15afd89 commit abdc55e

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
@@ -406,6 +406,8 @@ integration:prerelease:
406406
stage: integration
407407
needs:
408408
- integration:builds
409+
- job: build:prerelease
410+
optional: true
409411
- job: integration:nix
410412
optional: true
411413
- job: integration:docker
@@ -457,22 +459,16 @@ integration:prerelease:
457459
integration:merge:
458460
stage: integration
459461
needs:
460-
- job: build:merge
461-
artifacts: false
462+
- build:merge
462463
- job: integration:nix
463464
optional: true
464-
artifacts: false
465465
- job: integration:docker
466466
optional: true
467-
artifacts: false
468467
- job: integration:linux
469468
optional: true
470-
artifacts: false
471469
- job: integration:windows
472470
optional: true
473-
artifacts: false
474471
- job: integration:macos
475-
artifacts: false
476472
optional: true
477473
# Requires mutual exclusion
478474
resource_group: integration:merge
@@ -501,50 +497,49 @@ integration:merge:
501497
# Runs on tag pipeline where the tag is a prerelease or release version
502498
- if: $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
503499

504-
release:deployment:
500+
release:deployment:branch:
505501
stage: release
502+
# Only needs integration:builds from the staging branch pipeline
506503
needs:
507-
- job: integration:merge
508-
optional: true
509504
- project: $CI_PROJECT_PATH
510505
job: integration:builds
511506
ref: staging
512507
artifacts: true
513508
# Don't interrupt deploying job
514509
interruptible: false
515-
# Requires mutual exclusion
510+
# Requires mutual exclusion (also with release:deployment:tag)
516511
resource_group: release:deployment
517512
script:
518513
- echo 'Perform service deployment for production'
519514
rules:
520515
# Runs on master commits and ignores version commits
521516
- if: $CI_COMMIT_BRANCH == 'master' && $CI_COMMIT_TITLE !~ /^[0-9]+\.[0-9]+\.[0-9]+(?:-.*[0-9]+)?$/
517+
518+
release:deployment:tag:
519+
stage: release
520+
# Tag pipelines run independently
521+
needs:
522+
- integration:builds
523+
- integration:merge
524+
# Don't interrupt deploying job
525+
interruptible: false
526+
# Requires mutual exclusion (also with release:deployment:branch)
527+
resource_group: release:deployment
528+
script:
529+
- echo 'Perform service deployment for production'
530+
rules:
522531
# Runs on tag pipeline where the tag is a release version
523532
- if: $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/
524533

525534
release:distribution:
526535
stage: release
527536
needs:
528-
- job: integration:merge
529-
optional: true
530-
- job: release:deployment
531-
optional: true
532-
- project: $CI_PROJECT_PATH
533-
job: build:linux
534-
ref: staging
535-
artifacts: true
536-
- project: $CI_PROJECT_PATH
537-
job: build:windows
538-
ref: staging
539-
artifacts: true
540-
- project: $CI_PROJECT_PATH
541-
job: build:macos
542-
ref: staging
543-
artifacts: true
544-
- project: $CI_PROJECT_PATH
545-
job: integration:builds
546-
ref: staging
547-
artifacts: true
537+
- build:linux
538+
- build:windows
539+
- build:macos
540+
- integration:builds
541+
- integration:merge
542+
- release:deployment:tag
548543
# Don't interrupt publishing job
549544
interruptible: false
550545
before_script:

0 commit comments

Comments
 (0)