Merge "Zuul: Simplify the integrated test playbooks"

This commit is contained in:
Zuul 2018-12-11 12:47:30 +00:00 committed by Gerrit Code Review
commit e62606be91
2 changed files with 9 additions and 35 deletions

View File

@ -15,18 +15,6 @@
- hosts: all - hosts: all
tasks: tasks:
- name: Set current test repo (cross-repo)
set_fact:
current_test_repo: "git.openstack.org/{{ osa_test_repo }}"
when:
- osa_test_repo is defined
- name: Set current test repo (non-cross-repo)
set_fact:
current_test_repo: "{{ zuul.project.canonical_name }}"
when:
- osa_test_repo is not defined
- name: Run log collection script - name: Run log collection script
shell: | shell: |
source scripts/scripts-library.sh source scripts/scripts-library.sh
@ -34,18 +22,18 @@
become: yes become: yes
become_user: root become_user: root
args: args:
chdir: "{{ ansible_user_dir }}/src/{{ current_test_repo }}" chdir: "src/git.openstack.org/openstack/openstack-ansible"
executable: /bin/bash executable: /bin/bash
environment: environment:
# ZUUL_PROJECT is used by the log collection functions to enable # ZUUL_PROJECT is used by the log collection functions to enable
# log collection configuration specific to OpenStack CI # log collection configuration specific to OpenStack CI
ZUUL_PROJECT: "{{ zuul.project.short_name }}" ZUUL_PROJECT: "{{ zuul.project.short_name }}"
TEST_EXIT_CODE: "{{ zuul_success | lower }}" TEST_EXIT_CODE: "{{ zuul_success | lower }}"
GATE_LOG_DIR: "{{ ansible_user_dir }}/src/{{ current_test_repo }}/logs" GATE_LOG_DIR: "{{ ansible_user_dir }}/src/git.openstack.org/openstack/openstack-ansible/logs"
- name: Check whether a logs folder exists - name: Check whether a logs folder exists
stat: stat:
path: "{{ ansible_user_dir }}/src/{{ current_test_repo }}/logs" path: "{{ ansible_user_dir }}/src/git.openstack.org/openstack/openstack-ansible/logs"
get_attributes: no get_attributes: no
get_checksum: no get_checksum: no
get_md5: no get_md5: no
@ -54,7 +42,7 @@
- name: Copy logs back to the executor - name: Copy logs back to the executor
synchronize: synchronize:
src: "{{ ansible_user_dir }}/src/{{ current_test_repo }}/logs" src: "{{ ansible_user_dir }}/src/git.openstack.org/openstack/openstack-ansible/logs"
dest: "{{ zuul.executor.log_root }}/" dest: "{{ zuul.executor.log_root }}/"
mode: pull mode: pull
rsync_opts: rsync_opts:

View File

@ -1,29 +1,15 @@
- hosts: all - hosts: all
tasks: tasks:
- name: Set the Zuul sources path
set_fact:
zuul_src_path: "{{ ansible_user_dir }}/src"
- name: Set current test repo (cross-repo)
set_fact:
current_test_repo: "git.openstack.org/{{ osa_test_repo }}"
when:
- osa_test_repo is defined
- name: Set current test repo (non-cross-repo)
set_fact:
current_test_repo: "{{ zuul.project.canonical_name }}"
when:
- osa_test_repo is not defined
- name: Run gate-check-commit.sh script - name: Run gate-check-commit.sh script
become: yes become: yes
become_user: root become_user: root
command: "scripts/gate-check-commit.sh {{ scenario }} {{ action }} {{ install_method }}" shell: >-
scripts/gate-check-commit.sh {{ scenario }} {{ action }} {{ install_method }}
args: args:
chdir: "src/{{ current_test_repo }}" chdir: "src/git.openstack.org/openstack/openstack-ansible"
executable: /bin/bash
environment: environment:
# ZUUL_SRC_PATH is used by tests/get-ansible-role-requirements to # ZUUL_SRC_PATH is used by tests/get-ansible-role-requirements to
# where the CI provided git sources were cloned. # where the CI provided git sources were cloned.
ZUUL_SRC_PATH: "{{ zuul_src_path }}" ZUUL_SRC_PATH: "{{ ansible_user_dir }}/src"
ANSIBLE_PACKAGE: "{{ ansible_package | default('') }}" ANSIBLE_PACKAGE: "{{ ansible_package | default('') }}"