diff --git a/playbooks/static-docs/promote.yaml b/playbooks/static-docs/promote.yaml index 10c0cefeda..7d0490acdf 100644 --- a/playbooks/static-docs/promote.yaml +++ b/playbooks/static-docs/promote.yaml @@ -6,6 +6,10 @@ when: "zuul.branch is not defined" fail: msg: "This playbook must be run in a branch-based pipeline (e.g., 'promote')." + - name: Check target branch is master + when: "zuul.branch != 'master'" + fail: + msg: "This job should be only run on the master branch." - name: Download docs archive include_role: name: download-artifact @@ -34,14 +38,6 @@ command: "mv {{ item.path }} {{ zuul.executor.work_root }}/docs" with_items: "{{ pdf_files.files }}" when: pdf_files.matched > 0 - - name: Set target directory if master - when: "zuul.branch == 'master'" - set_fact: - target_dir: "{{ fileserver.path }}/{{ static_target }}/" - - name: Set target directory if not master - when: "zuul.branch != 'master'" - fail: - msg: "This jobs should be only run on master branch." - name: Add fileserver include_role: name: add-fileserver @@ -52,4 +48,4 @@ - name: Upload docs to static site synchronize: src: "{{ zuul.executor.work_root }}/docs/" - dest: "{{ target_dir }}" + dest: "{{ fileserver.path }}/{{ static_target }}"