bifrost/playbooks/ci/run.yaml
Dmitry Tantsur 3dbc7347ec Revert "Explicitly trap on ERR" and fix exit code hanlding
Trapping on ERR does not do what is implied here and is redundant when
trapping on EXIT is used together with `set -e`. The real problem is
that in the CI scripts we pipe test-bifrost.sh into tee with a log file
without setting -o pipefail in bash. This change fixes it.

This reverts commit b31bc66726.

Change-Id: Ifca4049f5967c0b2153ecffb4c153a96b4a62cc7
2021-11-22 10:35:29 +01:00

25 lines
1.3 KiB
YAML

- hosts: all
tasks:
- shell:
cmd: |
set -eo pipefail
./scripts/test-bifrost.sh 2>&1 | tee "{{ ansible_user_dir }}/bifrost.log"
chdir: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/bifrost'].src_dir }}"
executable: /bin/bash
environment:
BIFROST_TRACE: "true"
BUILD_IMAGE: "{{ build_image | default(false) | bool | lower }}"
CLI_TEST: "{{ cli_test | default(false) | bool | lower }}"
ENABLE_KEYSTONE: "{{ enable_keystone | default(false) | bool | lower }}"
LOG_LOCATION: "{{ ansible_user_dir }}/logs"
UPPER_CONSTRAINTS_FILE: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/requirements'].src_dir }}/upper-constraints.txt"
WORKSPACE: "{{ ansible_user_dir }}/src/opendev.org"
USE_DHCP: "{{ use_dhcp | default(false) | bool | lower }}"
ZUUL_BRANCH: "{{ zuul.branch }}"
BOOT_MODE: "{{ boot_mode | default('') }}"
TEST_VM_NODE_DRIVER: "{{ test_driver | default('ipmi') }}"
NOAUTH_MODE: "{{ noauth_mode | default(false) | bool | lower }}"
ENABLE_TLS: "{{ enable_tls | default(false) | bool | lower }}"
ENABLE_PROMETHEUS_EXPORTER: "{{ enable_prometheus_exporter | default(false) | bool | lower }}"
USE_VMEDIA: "{{ use_vmedia | default(false) | bool | lower }}"