From c03fc8790554676e61e8c452cdca8bd22dccd4e2 Mon Sep 17 00:00:00 2001 From: Tristan Cacqueray Date: Tue, 2 Jan 2018 04:49:38 +0000 Subject: [PATCH] Add buildset-artifacts-location Change-Id: I7db7633a8149c63a1e1232173fdc1d446fc70fbc Signed-off-by: Paul Belanger --- roles/buildset-artifacts-location/README.rst | 36 +++++++++++++++++++ .../tasks/main.yaml | 15 ++++++++ 2 files changed, 51 insertions(+) create mode 100644 roles/buildset-artifacts-location/README.rst create mode 100644 roles/buildset-artifacts-location/tasks/main.yaml diff --git a/roles/buildset-artifacts-location/README.rst b/roles/buildset-artifacts-location/README.rst new file mode 100644 index 000000000..b39dbd7bd --- /dev/null +++ b/roles/buildset-artifacts-location/README.rst @@ -0,0 +1,36 @@ +Return the location of buildset logs + +When a 'buildset' directory exists in the job logs, then use +zuul_return to set buildset_artifacts_url for children jobs. + +rpm-build job: +* Create a repository +* Fetch the repository to "{{ zuul.executor.log_root }}/buildset" +* Use the buildset-artifacts-location role + +rpm-test jobs: +* Install "{{ buildset_artficats_url }}" yum repository +* Run integration tests + +.. code-block:: yaml + + layout: + jobs: + - rpm-build + - rpm-test1: + dependencies: + - rpm-build + - rpm-test2: + dependencies: + - rpm-build + + +**Role Variables** + +.. zuul:rolevar:: zuul_log_url + + Base URL where logs are to be found. + +.. zuul:rolevar:: zuul_log_path + + Path of the logs. This optional when the role is used after 'upload-logs'. diff --git a/roles/buildset-artifacts-location/tasks/main.yaml b/roles/buildset-artifacts-location/tasks/main.yaml new file mode 100644 index 000000000..61649a785 --- /dev/null +++ b/roles/buildset-artifacts-location/tasks/main.yaml @@ -0,0 +1,15 @@ +--- +- name: Check for buildset artifacts + delegate_to: localhost + stat: + path: "{{ zuul.executor.log_root }}/buildset" + register: _buildset_artifacts + +- name: Define buildset artifacts location + delegate_to: localhost + zuul_return: + data: + buildset_artifacts_url: "{{ zuul_log_url }}/{{ zuul_log_path }}/buildset" + when: _buildset_artifacts.stat.exists + tags: + - skip_ansible_lint