diff --git a/.zuul.yaml b/.zuul.yaml index 9f028c6..304510c 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -66,15 +66,16 @@ name: airship-divingbell roles: - zuul: openstack/openstack-helm-infra - vars: - zuul_osh_infra_relative_path: ../../openstack/openstack-helm-infra/ timeout: 7200 pre-run: - tools/gate/playbooks/osh-infra-upgrade-host.yaml - - tools/gate/playbooks/osh-infra-deploy-docker.yaml - - tools/gate/playbooks/osh-infra-build.yaml - - tools/gate/playbooks/osh-infra-deploy-k8s.yaml - run: tools/gate/playbooks/airship-divingbell-check.yaml + run: tools/gate/playbooks/osh-infra-gate-runner.yaml + vars: + zuul_osh_infra_relative_path: ../../openstack/openstack-helm-infra/ + gate_scripts: + - "{{ zuul_osh_infra_relative_path }}./tools/deployment/common/005-deploy-k8s.sh" + - ./tools/gate/scripts/010-build-charts.sh + - sudo ./tools/gate/scripts/020-test-divingbell.sh post-run: tools/gate/playbooks/osh-infra-collect-logs.yaml required-projects: - openstack/openstack-helm-infra diff --git a/divingbell/templates/bin/_shcommon.tpl b/divingbell/templates/bin/_shcommon.tpl index 16d59df..5d90070 100644 --- a/divingbell/templates/bin/_shcommon.tpl +++ b/divingbell/templates/bin/_shcommon.tpl @@ -95,8 +95,9 @@ trap 'die' ERR set -x write_test(){ - touch "${1}/__write_test" && - rm "${1}/__write_test" || + local write_test_file + write_test_file=$(mktemp -p "${1}/" -t __write_test.XXXXXXXX) && + rm ${write_test_file} || die "Write test to ${1} failed." } diff --git a/tools/gate/playbooks/osh-infra-gate-runner.yaml b/tools/gate/playbooks/osh-infra-gate-runner.yaml new file mode 100644 index 0000000..a48ee5d --- /dev/null +++ b/tools/gate/playbooks/osh-infra-gate-runner.yaml @@ -0,0 +1,32 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +- hosts: primary + tasks: + - name: "creating directory for run artifacts" + file: + path: "/tmp/artifacts" + state: directory + - name: Run gate scripts + include_role: + name: osh-run-script + vars: + gate_script_path: "{{ item }}" + with_items: "{{ gate_scripts }}" + - name: "Downloads artifacts to executor" + synchronize: + src: "/tmp/artifacts" + dest: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}" + mode: pull + ignore_errors: True diff --git a/tools/gate/scripts/020-test-divingbell.sh b/tools/gate/scripts/020-test-divingbell.sh index 97b9a28..b07c400 100755 --- a/tools/gate/scripts/020-test-divingbell.sh +++ b/tools/gate/scripts/020-test-divingbell.sh @@ -27,7 +27,7 @@ if [[ $script_running = 'true' ]]; then fi NAME=divingbell -: ${LOGS_DIR:=/var/log} +: ${LOGS_DIR:=/tmp/artifacts} : ${LOGS_SUBDIR:=${LOGS_DIR}/${NAME}/$(date +"%m-%d-%y_%H:%M:%S")} mkdir -p "${LOGS_SUBDIR}" LOG_NAME="${LOGS_SUBDIR}/test.log"