Commit de2f69ff authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

fix(config): replace parallel:matrix job impl with explicit inheritance to...

fix(config): replace parallel:matrix job impl with explicit inheritance to allow user multi-template instantiation
parent ff01e4f7
Loading
Loading
Loading
Loading
+75 −23
Original line number Diff line number Diff line
@@ -918,8 +918,13 @@ stages:
  environment:
    action: stop

# run compose config job as parallel matrix
compose-config:
# compose config job prototype
# Can be extended for each concrete environment
#
# @var ENV_TYPE      : environment type
# @var ENV_APP_NAME  : env-specific application name
# @var ENV_APP_SUFFIX: env-specific application suffix
.compose-config:
  extends: .compose-base
  stage: package-test
  script:
@@ -933,19 +938,57 @@ compose-config:
      else
        $DCMP_CMD config $DCMP_CONFIG_OPTS
      fi
  parallel:
    matrix:
      - ENV_TYPE: review

compose-config-review:
  extends: .compose-config
  variables:
    ENV_TYPE: review
    ENV_APP_SUFFIX: "-review-slug"
    ENV_APP_NAME: "$DCMP_REVIEW_APP_NAME"
      - ENV_TYPE: integration
  rules:
    # exclude tags
    - if: $CI_COMMIT_TAG
      when: never
    # exclude when $DCMP_CONFIG_DISABLED is set
    - if: '$DCMP_CONFIG_DISABLED == "true"'
      when: never
    # skip if $DCMP_REVIEW_DOCKER_HOST unset
    - if: '$DCMP_REVIEW_DOCKER_HOST == null || $DCMP_REVIEW_DOCKER_HOST == ""'
      when: never
    # skip if integration branch or prod branch
    - if: '$CI_COMMIT_REF_NAME =~ $INTEG_REF || $CI_COMMIT_REF_NAME =~ $PROD_REF'
      when: never
    # test policy rules must come last
    - !reference [.test-policy, rules]

compose-config-integration:
  extends: .compose-config
  variables:
    ENV_TYPE: integration
    ENV_APP_SUFFIX: "-integration"
    ENV_APP_NAME: "$DCMP_INTEG_APP_NAME"
      - ENV_TYPE: staging
  rules:
    # exclude tags
    - if: $CI_COMMIT_TAG
      when: never
    # exclude when $DCMP_CONFIG_DISABLED is set
    - if: '$DCMP_CONFIG_DISABLED == "true"'
      when: never
    # skip if $DCMP_INTEG_DOCKER_HOST unset
    - if: '$DCMP_INTEG_DOCKER_HOST == null || $DCMP_INTEG_DOCKER_HOST == ""'
      when: never
    # skip if prod branch
    - if: '$CI_COMMIT_REF_NAME =~ $PROD_REF'
      when: never
    # test policy rules must come last
    - !reference [.test-policy, rules]

compose-config-staging:
  extends: .compose-config
  variables:
    ENV_TYPE: staging
    ENV_APP_SUFFIX: "-staging"
        ENV_APP_NAME: "$DCMP_STAGINGAPP_NAME"
      - ENV_TYPE: production
        ENV_APP_NAME: "$DCMP_PROD_APP_NAME"
    ENV_APP_NAME: "$DCMP_STAGING_APP_NAME"
  rules:
    # exclude tags
    - if: $CI_COMMIT_TAG
@@ -953,17 +996,26 @@ compose-config:
    # exclude when $DCMP_CONFIG_DISABLED is set
    - if: '$DCMP_CONFIG_DISABLED == "true"'
      when: never
    # review: skip if $DCMP_REVIEW_DOCKER_HOST unset or integration branch or prod branch
    - if: '$ENV_TYPE == "review" && ($DCMP_REVIEW_DOCKER_HOST == null || $DCMP_REVIEW_DOCKER_HOST == "" || $CI_COMMIT_REF_NAME =~ $INTEG_REF || $CI_COMMIT_REF_NAME =~ $PROD_REF)'
    # skip if $DCMP_STAGING_DOCKER_HOST unset
    - if: '$DCMP_STAGING_DOCKER_HOST == null || $DCMP_STAGING_DOCKER_HOST == ""'
      when: never
    # integration: skip if $DCMP_INTEG_DOCKER_HOST unset or prod branch
    - if: '$ENV_TYPE == "integration" && ($DCMP_INTEG_DOCKER_HOST == null || $DCMP_INTEG_DOCKER_HOST == "" || $CI_COMMIT_REF_NAME =~ $PROD_REF)'
    # test policy rules must come last
    - !reference [.test-policy, rules]

compose-config-production:
  extends: .compose-config
  variables:
    ENV_TYPE: production
    ENV_APP_NAME: "$DCMP_STAGING_APP_NAME"
  rules:
    # exclude tags
    - if: $CI_COMMIT_TAG
      when: never
    # staging: skip if $DCMP_STAGING_DOCKER_HOST unset
    - if: '$ENV_TYPE == "staging" && ($DCMP_STAGING_DOCKER_HOST == null || $DCMP_STAGING_DOCKER_HOST == "")'
    # exclude when $DCMP_CONFIG_DISABLED is set
    - if: '$DCMP_CONFIG_DISABLED == "true"'
      when: never
    # production: skip if $DCMP_PROD_DOCKER_HOST unset
    - if: '$ENV_TYPE == "production" && ($DCMP_PROD_DOCKER_HOST == null || $DCMP_PROD_DOCKER_HOST == "")'
    # skip if $DCMP_PROD_DOCKER_HOST unset
    - if: '$DCMP_PROD_DOCKER_HOST == null || $DCMP_PROD_DOCKER_HOST == ""'
      when: never
    # test policy rules must come last
    - !reference [.test-policy, rules]