Skip to content

Commit 902ff70

Browse files
authored
Fix stf-run-ci mutually exclusive deployment flags (#686)
Fail when two or more of the non compatible deployment options are set. To make the check simpler, convert them to integers (where true becomes 1 and false becomes 0) and check if their sum is greater than 1. Closes-Bug: OSPRH-20165
1 parent 9be2832 commit 902ff70

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

build/stf-run-ci/tasks/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727

2828
- name: Fail on mutually exclusive flags (deploy from prebuilt bundles, local builds or deploy from catalog)
2929
ansible.builtin.fail:
30-
msg: __deploy_from_bundles_enabled, __local_build_enabled and __deploy_from_catalog are mutually exclusive deployment options
31-
when:
32-
- __local_build_enabled | bool
33-
- __deploy_from_bundles_enabled | bool
34-
- __deploy_from_catalog | bool
30+
msg: __deploy_from_bundles_enabled, __local_build_enabled and __deploy_from_catalog are mutually exclusive deployment options. Only one can be true.
31+
when: >-
32+
(__local_build_enabled | bool | int) +
33+
(__deploy_from_bundles_enabled | bool | int) +
34+
(__deploy_from_catalog | bool | int) > 1
3535
3636
- name: Fail on mutually exclusive flags (deploy from index or deploy from catalog)
3737
ansible.builtin.fail:

0 commit comments

Comments
 (0)