diff --git a/playbooks/publications-index/run.yaml b/playbooks/publications-index/run.yaml new file mode 100644 index 0000000000..08357fe13c --- /dev/null +++ b/playbooks/publications-index/run.yaml @@ -0,0 +1,6 @@ +- hosts: all + tasks: + - name: Run make-index + command: ./make-index + args: + chdir: '{{ zuul.project.src_dir }}' diff --git a/playbooks/publications/run.yaml b/playbooks/publications/run.yaml new file mode 100644 index 0000000000..f68982d070 --- /dev/null +++ b/playbooks/publications/run.yaml @@ -0,0 +1,22 @@ +- hosts: all + roles: + - role: write-root-marker + root_marker_dir: "{{ zuul.project.src_dir }}/" + + post_tasks: + - name: Copy content directly to proper place for publishing + shell: + cmd: | + set -x + # NAME will either be the branch name or the tag name + NAME=`echo $ZUUL_REFNAME | sed 's/refs.tags.//'` + mkdir -p _out/$NAME + for FN in * ; do + if [ "_out" != "$FN" ] ; then + mv $FN _out/$NAME/ + fi + done + # Explicitly copy the root marker file + mv .root-marker _out/$NAME/ + executable: /bin/bash + chdir: '{{ zuul.project.src_dir }}' diff --git a/playbooks/publish/publications-index.yaml b/playbooks/publish/publications-index.yaml new file mode 100644 index 0000000000..bd3e4e6874 --- /dev/null +++ b/playbooks/publish/publications-index.yaml @@ -0,0 +1,20 @@ +- hosts: all + roles: + - fetch-tox-output + - role: write-root-marker + root_marker_dir: "{{ zuul.project.src_dir }}/output" + when: zuul_success | bool + - role: fetch-sphinx-output + sphinx_output_src: "{{ zuul.project.src_dir }}/output/" + zuul_executor_dest: "{{ zuul.executor.work_root }}/artifacts" + when: zuul_success | bool + +- hosts: localhost + roles: + - role: create-afs-token + when: zuul_success | bool + - role: upload-afs + afs_target: "{{ afs.path }}/infra/publications/" + when: zuul_success | bool + - role: destroy-afs-token + when: zuul_success | bool diff --git a/playbooks/publish/publications.yaml b/playbooks/publish/publications.yaml new file mode 100644 index 0000000000..7ced6e2c31 --- /dev/null +++ b/playbooks/publish/publications.yaml @@ -0,0 +1,16 @@ +- hosts: all + roles: + - role: fetch-sphinx-output + sphinx_output_src: "{{ zuul.project.src_dir }}/_out" + zuul_executor_dest: "{{ zuul.executor.work_root }}/artifacts" + when: zuul_success | bool + +- hosts: localhost + roles: + - role: create-afs-token + when: zuul_success | bool + - role: upload-afs + afs_target: "{{ afs.path }}/infra/publications/" + when: zuul_success | bool + - role: destroy-afs-token + when: zuul_success | bool diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 6a2d3f37cb..b3acbdb0e5 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -389,6 +389,44 @@ - secret: afsdocs_secret name: afs +- job: + name: publish-infra-publications-index + description: | + Publish the publication index + final: true + pre-run: playbooks/python-docs/pre.yaml + run: playbooks/publications-index/run.yaml + post-run: playbooks/publish/publications-index.yaml + allowed-projects: + - openstack-infra/publications + roles: + - zuul: openstack-infra/zuul-jobs + - zuul: openstack-infra/openstack-zuul-jobs + vars: + tox_envlist: infra-docs + secrets: + - secret: afsdocs_secret + name: afs + +- job: + name: publish-infra-publications + description: | + Publish one publication from openstack-infra/publications + final: true + pre-run: playbooks/python-docs/pre.yaml + run: playbooks/publications/run.yaml + post-run: playbooks/publish/publications.yaml + allowed-projects: + - openstack-infra/publications + roles: + - zuul: openstack-infra/zuul-jobs + - zuul: openstack-infra/openstack-zuul-jobs + vars: + tox_envlist: infra-docs + secrets: + - secret: afsdocs_secret + name: afs + - job: name: publish-openstack-python-branch-tarball parent: publish-openstack-artifacts diff --git a/zuul.d/projects.yaml b/zuul.d/projects.yaml index 5b57c8fafa..833cc2412f 100644 --- a/zuul.d/projects.yaml +++ b/zuul.d/projects.yaml @@ -1129,15 +1129,14 @@ - noop-jobs post: jobs: - - legacy-infra-publications-publish: - branches: ^(?!master).*$ - - legacy-infra-publications-publish-index: + - publish-infra-publications: branches: ^(?!master).*$ + - publish-infra-publications-index tag: jobs: - - legacy-infra-publications-publish: + - publish-infra-publications: branches: ^(?!master).*$ - - legacy-infra-publications-publish-index: + - publish-infra-publications-index: branches: ^(?!master).*$ - project: