From cdd125117f0ca65300b608734caa2eb36779fcea Mon Sep 17 00:00:00 2001 From: Jeffrey Zhang Date: Fri, 20 Oct 2017 13:50:21 +0800 Subject: Optimize zuul v3 jobs - move check container failure from post.yml to run.yml - add binary related jobs - use static kolla-ansible src dir, which is helpful for kolla project to use. - generate correct /etc/hosts by using private ip address and hostname - fix the wrong api interface in global.yml file Change-Id: Idfdee6dfe18f0fa2d4f984df59b57553122ce298 --- tools/setup_gate.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tools') diff --git a/tools/setup_gate.sh b/tools/setup_gate.sh index 8e97d6b68..2af7ede5c 100755 --- a/tools/setup_gate.sh +++ b/tools/setup_gate.sh @@ -151,6 +151,23 @@ function sanity_check { fi } +check_failure() { + # All docker container's status are created, restarting, running, removing, + # paused, exited and dead. Containers without running status are treated as + # failure. removing is added in docker 1.13, just ignore it now. + failed_containers=$(sudo docker ps -a --format "{{.Names}}" \ + --filter status=created \ + --filter status=restarting \ + --filter status=paused \ + --filter status=exited \ + --filter status=dead) + + if [[ -n "$failed_containers" ]]; then + exit 1; + fi +} + + clone_repos setup_ansible @@ -191,3 +208,5 @@ tools/kolla-ansible -i ${RAW_INVENTORY} -vvv prechecks > /tmp/logs/ansible/prech ara generate html /tmp/logs/playbook_reports/ gzip --recursive --best /tmp/logs/playbook_reports/ + +check_failure -- cgit v1.2.3