Break out testing into its own triple-parallelized flow

This commit is contained in:
Salt 2021-08-05 01:27:41 -05:00
parent 0c1fab838f
commit 9e5e2a23d4

View File

@ -39,6 +39,7 @@ after_script:
[ -n "$ZEROTIER_NETWORK_ID" ] && \ [ -n "$ZEROTIER_NETWORK_ID" ] && \
zerotier-cli leave "$ZEROTIER_NETWORK_ID" zerotier-cli leave "$ZEROTIER_NETWORK_ID"
## HOUSEKEEPING
Lint: Lint:
stage: lint stage: lint
allow_failure: yes allow_failure: yes
@ -50,31 +51,45 @@ Lint:
- ansible-lint --version - ansible-lint --version
- ansible-lint site.yml - ansible-lint site.yml
Test: ## TEST
.test:
stage: test stage: test
interruptible: yes interruptible: yes
except: except:
- pipelines - pipelines
script: allow_failure:
- ansible-playbook --skip-tags no-test -C site.yml --vault-password-file /vaultpw || error="$?" exit_codes:
- if [ "$error" -eq 4 ]; then echo "Some hosts were unreachable; masking error"; unset error; fi - 4
- if [ -n "$error" ]; then echo "Return code $error"; false; fi
Play_Against_Pis: pis:test:
stage: play extends: .test
script: script:
- ansible-playbook -l tags_pis site.yml --vault-password-file /vaultpw || error="$?" - ansible-playbook -l tags_pis --skip-tags no-test -C site.yml --vault-password-file /vaultpw
- if [ "$error" -eq 4 ]; then echo "Some hosts were unreachable; masking error"; unset error; fi desktop:test:
- if [ -n "$error" ]; then echo "Return code $error"; false; fi extends: .test
Play_Against_Desktops:
stage: play
script: script:
- ansible-playbook -l tags_desktop site.yml --vault-password-file /vaultpw || error="$?" - ansible-playbook -l tags_desktop --skip-tags no-test -C site.yml --vault-password-file /vaultpw
- if [ "$error" -eq 4 ]; then echo "Some hosts were unreachable; masking error"; unset error; fi prod:test:
- if [ -n "$error" ]; then echo "Return code $error"; false; fi extends: .test
Play_Against_Production:
stage: play
script: script:
- ansible-playbook -l tags_prod site.yml --vault-password-file /vaultpw || error="$?" - ansible-playbook -l tags_prod --skip-tags no-test -C site.yml --vault-password-file /vaultpw
- if [ "$error" -eq 4 ]; then echo "Some hosts were unreachable; masking error"; unset error; fi
- if [ -n "$error" ]; then echo "Return code $error"; false; fi ## PLAY
.play:
stage: play
allow_failure:
exit_codes:
- 4
pis:play:
extends: .play
script:
- ansible-playbook -l tags_pis site.yml --vault-password-file /vaultpw
desktop:play:
extends: .play
script:
- ansible-playbook -l tags_desktop site.yml --vault-password-file /vaultpw
prod:play:
extends: .play
script:
- ansible-playbook -l tags_prod site.yml --vault-password-file /vaultpw