Commit d56f8231 authored by Jonathan GAYVALLET's avatar Jonathan GAYVALLET Committed by Pierre Smeyers
Browse files

fix: sanitize empty variable test expressions

rewrite all '$SOME_VAR' test expressions to '($SOME_VAR != null && $SOME_VAR != "")'
parent f26e8422
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -848,7 +848,7 @@ ansible-review:
    - if: $CI_COMMIT_TAG
      when: never
    # only on non-production, non-integration branches, with $ANSIBLE_REVIEW_PLAYBOOK_FILE set
    - if: '$ANSIBLE_REVIEW_PLAYBOOK_FILE && $CI_COMMIT_REF_NAME !~ $PROD_REF && $CI_COMMIT_REF_NAME !~ $INTEG_REF'
    - if: '($ANSIBLE_REVIEW_PLAYBOOK_FILE != null && $ANSIBLE_REVIEW_PLAYBOOK_FILE != "") && $CI_COMMIT_REF_NAME !~ $PROD_REF && $CI_COMMIT_REF_NAME !~ $INTEG_REF'

# stop review env (only for branches)
ansible-cleanup-review:
@@ -876,7 +876,7 @@ ansible-cleanup-review:
    - if: '$CI_COMMIT_REF_NAME =~ $PROD_REF || $CI_COMMIT_REF_NAME =~ $INTEG_REF'
      when: never
    # only if $ANSIBLE_REVIEW_CLEANUP_PLAYBOOK_FILE or $ANSIBLE_REVIEW_CLEANUP_TAGS set
    - if: '$ANSIBLE_REVIEW_CLEANUP_PLAYBOOK_FILE || $ANSIBLE_REVIEW_CLEANUP_TAGS'
    - if: '($ANSIBLE_REVIEW_CLEANUP_PLAYBOOK_FILE != null && $ANSIBLE_REVIEW_CLEANUP_PLAYBOOK_FILE != "") || ($ANSIBLE_REVIEW_CLEANUP_TAGS != null && $ANSIBLE_REVIEW_CLEANUP_TAGS != "")'
      when: manual
      allow_failure: true

@@ -903,7 +903,7 @@ ansible-integration:
  resource_group: integration
  rules:
    # only on integration branch(es), with $ANSIBLE_INTEG_PLAYBOOK_FILE set
    - if: '$ANSIBLE_INTEG_PLAYBOOK_FILE && $CI_COMMIT_REF_NAME =~ $INTEG_REF'
    - if: '($ANSIBLE_INTEG_PLAYBOOK_FILE != null && $ANSIBLE_INTEG_PLAYBOOK_FILE != "") && $CI_COMMIT_REF_NAME =~ $INTEG_REF'


# stop integration env (only for branches)
@@ -929,7 +929,7 @@ ansible-cleanup-integration:
    - if: '$CI_COMMIT_REF_NAME !~ $INTEG_REF'
      when: never
    # only if $ANSIBLE_INTEG_CLEANUP_PLAYBOOK_FILE || $ANSIBLE_INTEG_CLEANUP_TAGS set
    - if: '$ANSIBLE_INTEG_CLEANUP_PLAYBOOK_FILE || $ANSIBLE_INTEG_CLEANUP_TAGS'
    - if: '($ANSIBLE_INTEG_CLEANUP_PLAYBOOK_FILE != null && $ANSIBLE_INTEG_CLEANUP_PLAYBOOK_FILE != "") || ($ANSIBLE_INTEG_CLEANUP_TAGS != null && $ANSIBLE_INTEG_CLEANUP_TAGS != "")'
      when: manual
      allow_failure: true

@@ -956,7 +956,7 @@ ansible-staging:
  resource_group: staging
  rules:
    # only on production branch(es), with $ANSIBLE_STAGING_PLAYBOOK_FILE set
    - if: '$ANSIBLE_STAGING_PLAYBOOK_FILE && $CI_COMMIT_REF_NAME =~ $PROD_REF'
    - if: '($ANSIBLE_STAGING_PLAYBOOK_FILE != null && $ANSIBLE_STAGING_PLAYBOOK_FILE != "") && $CI_COMMIT_REF_NAME =~ $PROD_REF'


# stop staging env (only for branches)
@@ -982,7 +982,7 @@ ansible-cleanup-staging:
    - if: '$CI_COMMIT_REF_NAME !~ $PROD_REF'
      when: never
    # only if $ANSIBLE_STAGING_CLEANUP_PLAYBOOK_FILE || $ANSIBLE_STAGING_CLEANUP_TAGS set
    - if: '$ANSIBLE_STAGING_CLEANUP_PLAYBOOK_FILE || $ANSIBLE_STAGING_CLEANUP_TAGS'
    - if: '($ANSIBLE_STAGING_CLEANUP_PLAYBOOK_FILE != null && $ANSIBLE_STAGING_CLEANUP_PLAYBOOK_FILE != "") || ($ANSIBLE_STAGING_CLEANUP_TAGS != null && $ANSIBLE_STAGING_CLEANUP_TAGS != "")'
      when: manual
      allow_failure: true