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

fix: sanitize empty variable test expressions

rewrite all '$SOME_VAR' test expressions to '($SOME_VAR != null && $SOME_VAR != "")'
parent 27317ddd
Loading
Loading
Loading
Loading
+29 −13
Original line number Diff line number Diff line
@@ -456,8 +456,11 @@ dbt-build-review:
    # exclude tags
    - if: $CI_COMMIT_TAG
      when: never
    # only on non-production, non-integration branches, with $XXX_REVIEW_PROJECT set
    - if: '$DBT_REVIEW_TARGET && $CI_COMMIT_REF_NAME !~ $PROD_REF && $CI_COMMIT_REF_NAME !~ $INTEG_REF'
    # exclude if $DBT_REVIEW_TARGET not set
    - if: '$DBT_REVIEW_TARGET == null || $DBT_REVIEW_TARGET == ""'
      when: never
    # only on non-production, non-integration branches
    - if: '$CI_COMMIT_REF_NAME !~ $PROD_REF && $CI_COMMIT_REF_NAME !~ $INTEG_REF'

dbt-build-integration:
  extends: .dbt-build
@@ -465,8 +468,11 @@ dbt-build-integration:
    ENV_TYPE: integration
    ENV_TARGET: "$DBT_INTEG_TARGET"
  rules:
    # only on integration branch(es), with $XXX_INTEG_PROJECT set
    - if: '$DBT_INTEG_TARGET && $CI_COMMIT_REF_NAME =~ $INTEG_REF'
    # exclude if $DBT_INTEG_TARGET not set
    - if: '$DBT_INTEG_TARGET == null || $DBT_INTEG_TARGET == ""'
      when: never
    # only on integration branch(es)
    - if: '$CI_COMMIT_REF_NAME =~ $INTEG_REF'

dbt-build-production:
  extends: .dbt-build
@@ -477,10 +483,11 @@ dbt-build-production:
    # exclude non-production branches
    - if: '$CI_COMMIT_REF_NAME !~ $PROD_REF'
      when: never
    # exclude if $XXX_PROD_PROJECT not set
    # exclude if $DBT_PROD_TARGET not set
    - if: '$DBT_PROD_TARGET == null || $DBT_PROD_TARGET == ""'
      when: never
    - if: '$DBT_PROD_TARGET && $CI_COMMIT_REF_NAME =~ $PROD_REF'
    # only on production branch(es)
    - if: '$CI_COMMIT_REF_NAME =~ $PROD_REF'


.dbt-deploy:
@@ -516,8 +523,11 @@ dbt-review:
    # exclude if $CLEANUP_ALL_REVIEW set to 'force'
    - if: '$CLEANUP_ALL_REVIEW == "force"'
      when: never
    # only on non-production, non-integration branches, with $XXX_REVIEW_PROJECT set
    - if: '$DBT_REVIEW_TARGET && $CI_COMMIT_REF_NAME !~ $PROD_REF && $CI_COMMIT_REF_NAME !~ $INTEG_REF'
    # exclude if $DBT_REVIEW_TARGET not set
    - if: '$DBT_REVIEW_TARGET == null || $DBT_REVIEW_TARGET == ""'
      when: never
    # only on non-production, non-integration branches
    - if: '$CI_COMMIT_REF_NAME !~ $PROD_REF && $CI_COMMIT_REF_NAME !~ $INTEG_REF'

# deploy to integration env (only on develop branch)
dbt-integration:
@@ -533,8 +543,11 @@ dbt-integration:
    # exclude if $DBT_DEPLOY_ENABLED not activated
    - if: '$DBT_DEPLOY_ENABLED != "true"'
      when: never
    # only on integration branch(es), with $XXX_INTEG_PROJECT set
    - if: '$DBT_INTEG_TARGET && $CI_COMMIT_REF_NAME =~ $INTEG_REF'
    # exclude if $DBT_INTEG_TARGET not set
    - if: '$DBT_INTEG_TARGET == null || $DBT_INTEG_TARGET == ""'
      when: never
    # only on integration branch(es)
    - if: '$CI_COMMIT_REF_NAME =~ $INTEG_REF'

# deploy to staging env (only on master branch)
dbt-staging:
@@ -550,8 +563,11 @@ dbt-staging:
    # exclude if $DBT_DEPLOY_ENABLED not activated
    - if: '$DBT_DEPLOY_ENABLED != "true"'
      when: never
    # only on production branch(es), with $XXX_STAGING_PROJECT set
    - if: '$DBT_STAGING_TARGET && $CI_COMMIT_REF_NAME =~ $PROD_REF'
    # exclude if $DBT_STAGING_TARGET not set
    - if: '$DBT_STAGING_TARGET == null || $DBT_STAGING_TARGET == ""'
      when: never
    # only on production branch(es)
    - if: '$CI_COMMIT_REF_NAME =~ $PROD_REF'

dbt-production:
  extends: .dbt-deploy
@@ -570,7 +586,7 @@ dbt-production:
    # exclude non-production branches
    - if: '$CI_COMMIT_REF_NAME !~ $PROD_REF'
      when: never
    # exclude if $XXX_PROD_PROJECT not set
    # exclude if $DBT_PROD_TARGET not set
    - if: '$DBT_PROD_TARGET == null || $DBT_PROD_TARGET == ""'
      when: never
    - if: '$DBT_PROD_DEPLOY_STRATEGY == "manual"'