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