From bec430ebc7c6194c300ffd456f1411e60d2aa585 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Sat, 25 Aug 2018 18:43:06 +0200 Subject: [PATCH] Import legacy-dg-hooks-dsvm job This job is used only by devstack-gate, import it. Rename it to devstack-gate-hooks following our naming policy. Change-Id: Id01d7cda5cb28b6371bdcf8b85208135caa9e9b1 --- .zuul.yaml | 9 +++++ playbooks/devstack-gate-hooks/post.yaml | 15 +++++++ playbooks/devstack-gate-hooks/run.yaml | 52 +++++++++++++++++++++++++ 3 files changed, 76 insertions(+) create mode 100644 playbooks/devstack-gate-hooks/post.yaml create mode 100644 playbooks/devstack-gate-hooks/run.yaml diff --git a/.zuul.yaml b/.zuul.yaml index bf1dbba8..e5f5f8ec 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -4,6 +4,14 @@ - name: primary label: ubuntu-xenial +- job: + name: devstack-gate-hooks + parent: legacy-dsvm-base + run: playbooks/devstack-gate-hooks/run.yaml + post-run: playbooks/devstack-gate-hooks/post.yaml + timeout: 3900 + + - project: check: jobs: @@ -21,3 +29,4 @@ voting: false - neutron-tempest-plugin-api: voting: false + - devstack-gate-hooks diff --git a/playbooks/devstack-gate-hooks/post.yaml b/playbooks/devstack-gate-hooks/post.yaml new file mode 100644 index 00000000..e07f5510 --- /dev/null +++ b/playbooks/devstack-gate-hooks/post.yaml @@ -0,0 +1,15 @@ +- hosts: primary + tasks: + + - name: Copy files from {{ ansible_user_dir }}/workspace/ on node + synchronize: + src: '{{ ansible_user_dir }}/workspace/' + dest: '{{ zuul.executor.log_root }}' + mode: pull + copy_links: true + verify_host: true + rsync_opts: + - --include=/logs/** + - --include=*/ + - --exclude=* + - --prune-empty-dirs diff --git a/playbooks/devstack-gate-hooks/run.yaml b/playbooks/devstack-gate-hooks/run.yaml new file mode 100644 index 00000000..72e0e063 --- /dev/null +++ b/playbooks/devstack-gate-hooks/run.yaml @@ -0,0 +1,52 @@ +- hosts: all + name: Autoconverted job legacy-dg-hooks-dsvm from old job gate-dg-hooks-dsvm + tasks: + + - name: Ensure legacy workspace directory + file: + path: '{{ ansible_user_dir }}/workspace' + state: directory + + - shell: + cmd: | + set -e + set -x + cat > clonemap.yaml << EOF + clonemap: + - name: openstack-infra/devstack-gate + dest: devstack-gate + EOF + /usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \ + git://git.openstack.org \ + openstack-infra/devstack-gate + executable: /bin/bash + chdir: '{{ ansible_user_dir }}/workspace' + environment: '{{ zuul | zuul_legacy_vars }}' + + - shell: + cmd: | + set -e + set -x + export PYTHONUNBUFFERED=true + + # place calls for all hooks in here + function pre_test_hook { + echo "I am totally an awesome pre_test_hook" + } + export -f pre_test_hook + + function gate_hook { + echo "I am totally an awesome gate_hook" + } + export -f gate_hook + + function post_test_hook { + echo "I am totally an awesome post_test_hook" + } + export -f post_test_hook + + cp devstack-gate/devstack-vm-gate-wrap.sh ./safe-devstack-vm-gate-wrap.sh + ./safe-devstack-vm-gate-wrap.sh + executable: /bin/bash + chdir: '{{ ansible_user_dir }}/workspace' + environment: '{{ zuul | zuul_legacy_vars }}'