From c93a1b21a2b439cb32234d0cc4ab4318249f4de2 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Sat, 17 Feb 2018 19:19:26 +0100 Subject: [PATCH] Use playbooks/publish/openstack-afs everywhere We duplicate the afs upload in many playbooks, use instead the now parameterized playbooks/publish/openstack-afs playbook. Change-Id: I3c6b9b5eb82a2628411571299eaedbf11f0e5d56 --- playbooks/publish/contributor-guide-afs.yaml | 10 ---- playbooks/publish/deploy-guide.yaml | 10 ---- playbooks/publish/infra-afs.yaml | 9 ---- playbooks/publish/infra-index.yaml | 10 ---- playbooks/publish/infra-manual.yaml | 9 ---- playbooks/publish/manuals.yaml | 10 ---- playbooks/publish/placement-api-ref.yaml | 10 ---- playbooks/publish/publications-index.yaml | 10 ---- playbooks/publish/publications.yaml | 10 ---- playbooks/publish/releasenotes.yaml | 10 ---- zuul.d/jobs.yaml | 53 ++++++++++++++++---- 11 files changed, 42 insertions(+), 109 deletions(-) delete mode 100644 playbooks/publish/infra-afs.yaml delete mode 100644 playbooks/publish/infra-manual.yaml diff --git a/playbooks/publish/contributor-guide-afs.yaml b/playbooks/publish/contributor-guide-afs.yaml index 2195fadda4..81c0714250 100644 --- a/playbooks/publish/contributor-guide-afs.yaml +++ b/playbooks/publish/contributor-guide-afs.yaml @@ -6,13 +6,3 @@ sphinx_output_suffix: "/" 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 }}/contributors" - when: zuul_success | bool - - role: destroy-afs-token - when: zuul_success | bool diff --git a/playbooks/publish/deploy-guide.yaml b/playbooks/publish/deploy-guide.yaml index f829285d04..75a3e52c37 100644 --- a/playbooks/publish/deploy-guide.yaml +++ b/playbooks/publish/deploy-guide.yaml @@ -8,13 +8,3 @@ sphinx_output_suffix: "/" 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 }}/project-deploy-guide/{{ zuul.project.short_name }}" - when: zuul_success | bool - - role: destroy-afs-token - when: zuul_success | bool diff --git a/playbooks/publish/infra-afs.yaml b/playbooks/publish/infra-afs.yaml deleted file mode 100644 index 166d04980a..0000000000 --- a/playbooks/publish/infra-afs.yaml +++ /dev/null @@ -1,9 +0,0 @@ -- hosts: localhost - roles: - - role: create-afs-token - when: zuul_success | bool - - role: upload-afs - afs_target: "{{ afs.path }}/infra/{{ zuul.project.short_name }}" - when: zuul_success | bool - - role: destroy-afs-token - when: zuul_success | bool diff --git a/playbooks/publish/infra-index.yaml b/playbooks/publish/infra-index.yaml index a3aafbf296..21c4d0544e 100644 --- a/playbooks/publish/infra-index.yaml +++ b/playbooks/publish/infra-index.yaml @@ -8,13 +8,3 @@ sphinx_output_src: "src/{{ zuul.project.canonical_name }}/docs-site/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" - when: zuul_success | bool - - role: destroy-afs-token - when: zuul_success | bool diff --git a/playbooks/publish/infra-manual.yaml b/playbooks/publish/infra-manual.yaml deleted file mode 100644 index 6022135ea9..0000000000 --- a/playbooks/publish/infra-manual.yaml +++ /dev/null @@ -1,9 +0,0 @@ -- hosts: localhost - roles: - - role: create-afs-token - when: zuul_success | bool - - role: upload-afs - afs_target: "{{ afs.path }}/infra/manual" - when: zuul_success | bool - - role: destroy-afs-token - when: zuul_success | bool diff --git a/playbooks/publish/manuals.yaml b/playbooks/publish/manuals.yaml index da1e1f5cdf..bbd8e0d502 100644 --- a/playbooks/publish/manuals.yaml +++ b/playbooks/publish/manuals.yaml @@ -5,13 +5,3 @@ sphinx_output_src: "{{ zuul.project.src_dir }}/publish-docs/" 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 }}" - when: zuul_success | bool - - role: destroy-afs-token - when: zuul_success | bool diff --git a/playbooks/publish/placement-api-ref.yaml b/playbooks/publish/placement-api-ref.yaml index b0f023c986..81c0714250 100644 --- a/playbooks/publish/placement-api-ref.yaml +++ b/playbooks/publish/placement-api-ref.yaml @@ -6,13 +6,3 @@ sphinx_output_suffix: "/" 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 }}/api-ref/placement" - when: zuul_success | bool - - role: destroy-afs-token - when: zuul_success | bool diff --git a/playbooks/publish/publications-index.yaml b/playbooks/publish/publications-index.yaml index bd3e4e6874..a43126aefe 100644 --- a/playbooks/publish/publications-index.yaml +++ b/playbooks/publish/publications-index.yaml @@ -8,13 +8,3 @@ 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 index 599e689db5..e89517d7b1 100644 --- a/playbooks/publish/publications.yaml +++ b/playbooks/publish/publications.yaml @@ -4,13 +4,3 @@ 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/playbooks/publish/releasenotes.yaml b/playbooks/publish/releasenotes.yaml index b8f0bf09b0..81c0714250 100644 --- a/playbooks/publish/releasenotes.yaml +++ b/playbooks/publish/releasenotes.yaml @@ -6,13 +6,3 @@ sphinx_output_suffix: "/" 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 }}/releasenotes/{{ zuul.project.short_name }}" - 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 64208621bb..febff287e7 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -326,11 +326,15 @@ final: true pre-run: playbooks/sphinx/pre.yaml run: playbooks/sphinx/run.yaml - post-run: playbooks/publish/contributor-guide-afs.yaml + post-run: + - playbooks/publish/contributor-guide-afs.yaml + - playbooks/publish/openstack-afs.yaml roles: - zuul: openstack-infra/zuul-jobs - zuul: openstack-infra/openstack-zuul-jobs branches: master + vars: + afs_subpath: "/contributors" secrets: - secret: afsdocs_secret name: afs @@ -376,13 +380,16 @@ final: true pre-run: playbooks/releasenotes/pre.yaml run: playbooks/releasenotes/run.yaml - post-run: playbooks/publish/releasenotes.yaml + post-run: + - playbooks/publish/releasenotes.yaml + - playbooks/publish/openstack-afs.yaml override-branch: master required-projects: - name: openstack/requirements roles: - zuul: openstack-infra/zuul-jobs vars: + afs_subpath: "/releasenotes/{{ zuul.project.short_name }}" constraints_file: '{{ ansible_user_dir }}/src/git.openstack.org/openstack/requirements/upper-constraints.txt' sphinx_build_dir: releasenotes/build secrets: @@ -436,10 +443,12 @@ run: playbooks/sphinx/run.yaml post-run: - playbooks/sphinx/post-infra.yaml - - playbooks/publish/infra-afs.yaml + - playbooks/publish/openstack-afs.yaml roles: - zuul: openstack-infra/zuul-jobs - zuul: openstack-infra/openstack-zuul-jobs + vars: + afs_subpath: "/infra/{{ zuul.project.short_name }}" secrets: - secret: afsdocs_secret name: afs @@ -456,8 +465,9 @@ run: playbooks/sphinx/run.yaml post-run: - playbooks/sphinx/post-infra.yaml - - playbooks/publish/infra-afs.yaml + - playbooks/publish/openstack-afs.yaml vars: + afs_subpath: "/infra/{{ zuul.project.short_name }}" sphinx_python: python3 roles: - zuul: openstack-infra/zuul-jobs @@ -475,12 +485,14 @@ run: playbooks/sphinx/run.yaml post-run: - playbooks/sphinx/post-infra.yaml - - playbooks/publish/infra-manual.yaml + - playbooks/publish/openstack-afs.yaml allowed-projects: - openstack-infra/infra-manual roles: - zuul: openstack-infra/zuul-jobs - zuul: openstack-infra/openstack-zuul-jobs + vars: + afs_subpath: "/infra/manual" secrets: - secret: afsdocs_secret name: afs @@ -511,7 +523,9 @@ final: true pre-run: playbooks/project-config/pre-tox.yaml run: playbooks/project-config/run-tox.yaml - post-run: playbooks/publish/infra-index.yaml + post-run: + - playbooks/publish/infra-index.yaml + - playbooks/publish/openstack-afs.yaml allowed-projects: - openstack-infra/project-config roles: @@ -519,6 +533,7 @@ - zuul: openstack-infra/openstack-zuul-jobs vars: tox_envlist: infra-docs + afs_path: "/infra" secrets: - secret: afsdocs_secret name: afs @@ -529,13 +544,16 @@ Publish the publication index final: true run: playbooks/publications-index/run.yaml - post-run: playbooks/publish/publications-index.yaml + post-run: + - playbooks/publish/publications-index.yaml + - playbooks/publish/openstack-afs.yaml allowed-projects: - openstack-infra/publications roles: - zuul: openstack-infra/zuul-jobs - zuul: openstack-infra/openstack-zuul-jobs vars: + afs_subpath: "/infra/publications/" tox_envlist: infra-docs secrets: - secret: afsdocs_secret @@ -547,13 +565,16 @@ Publish one publication from openstack-infra/publications final: true run: playbooks/publications/run.yaml - post-run: playbooks/publish/publications.yaml + post-run: + - playbooks/publish/publications.yaml + - playbooks/publish/openstack-afs.yaml allowed-projects: - openstack-infra/publications roles: - zuul: openstack-infra/zuul-jobs - zuul: openstack-infra/openstack-zuul-jobs vars: + afs_subpath: "/infra/publications/" tox_envlist: infra-docs secrets: - secret: afsdocs_secret @@ -716,11 +737,15 @@ name: publish-openstack-manuals parent: publish-openstack-manuals-base final: true - post-run: playbooks/publish/manuals.yaml + post-run: + - playbooks/publish/manuals.yaml + - playbooks/publish/openstack-afs.yaml allowed-projects: - openstack/openstack-manuals - openstack/security-doc - openstack/training-guides + vars: + afs_subpath: "" secrets: - secret: afsdocs_secret name: afs @@ -814,7 +839,9 @@ - openstack/nova pre-run: playbooks/sphinx/pre.yaml run: playbooks/sphinx/run.yaml - post-run: playbooks/publish/placement-api-ref.yaml + post-run: + - playbooks/publish/placement-api-ref.yaml + - playbooks/publish/openstack-afs.yaml roles: - zuul: openstack-infra/zuul-jobs - zuul: openstack-infra/openstack-zuul-jobs @@ -822,6 +849,7 @@ # for changes on other branches. branches: master vars: + afs_subpath: "/api-ref/placement" sphinx_build_dir: placement-api-ref/build sphinx_source_dir: placement-api-ref/source secrets: @@ -857,11 +885,14 @@ https://docs.openstack.org/project-deploy-guide/ pre-run: playbooks/sphinx/pre.yaml run: playbooks/sphinx/run.yaml - post-run: playbooks/publish/deploy-guide.yaml + post-run: + - playbooks/publish/deploy-guide.yaml + - playbooks/publish/openstack-afs.yaml roles: - zuul: openstack-infra/zuul-jobs - zuul: openstack-infra/openstack-zuul-jobs vars: + afs_subpath: "/project-deploy-guide/{{ zuul.project.short_name }}" sphinx_build_dir: deploy-guide/build sphinx_source_dir: deploy-guide/source secrets: