Skip to content
Snippets Groups Projects
Commit 64dc51d3 authored by Tim Jaacks's avatar Tim Jaacks
Browse files

Use regex operator to check for multiple variables

The "&&" operator does not work as expected when checking if multiple
variables are set.

See for reference:
https://gitlab.com/gitlab-org/gitlab/-/issues/321371
parent 89fbce24
No related branches found
No related tags found
1 merge request!340Hide stages if corresponding variables are not set
Pipeline #80964 passed with stage
in 26 minutes and 36 seconds
...@@ -230,7 +230,9 @@ azure-{{ machine }}: ...@@ -230,7 +230,9 @@ azure-{{ machine }}:
extends: .deploy-azure extends: .deploy-azure
stage: Deploy Azure stage: Deploy Azure
rules: rules:
- if: $AZURE_CONTAINER_NAME && $AZURE_TARGET_FOLDER # "=~ /^./" is the GitLab way of checking whether a variable is set and not empty.
# See for reference: https://gitlab.com/gitlab-org/gitlab/-/issues/321371
- if: $AZURE_CONTAINER_NAME =~ /^./ && $AZURE_TARGET_FOLDER =~ /^./
when: manual when: manual
allow_failure: true allow_failure: true
variables: variables:
...@@ -262,7 +264,7 @@ azure-{{ machine }}: ...@@ -262,7 +264,7 @@ azure-{{ machine }}:
.confluence-rules: .confluence-rules:
rules: rules:
- if: $CONFLUENCE_PARENT_ID && $CONFLUENCE_SPACE - if: $CONFLUENCE_PARENT_ID =~ /^./ && $CONFLUENCE_SPACE =~ /^./
when: manual when: manual
allow_failure: true allow_failure: true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment