Debian Codegraph @

ansible_collections/google/cloud/tests/integration/targets/inventory_gce/runme.sh

raw symbols SCIP
1 #!/usr/bin/env bash
2
3 set -eux
4
5 # test infra
6 ansible-playbook playbooks/setup.yml "$@"
7
8 export ANSIBLE_INVENTORY=test.gcp_compute.yml
9
10 RC=0
11 # we want to run teardown regardless of playbook exit status, so catch the
12 # exit code of ansible-playbook manually
13 set +e
14 for ts in testcase_*.yml;
15 do
16 testcase=$( basename "$ts" | sed -e 's/testcase_//' | sed -e 's/.yml//' )
17 ansible-playbook playbooks/test.yml "$@" --extra-vars "testcase=${testcase}"
18 RC=$?
19 test $RC -ne 0 && break
20 done
21 set -e
22
23 unset ANSIBLE_INVENTORY
24
25 # delete test infra
26 ansible-playbook playbooks/teardown.yml "$@"
27
28 exit $RC