Merge "Switch specs publishing to AFS"

This commit is contained in:
Zuul 2020-02-20 02:53:23 +00:00 committed by Gerrit Code Review
commit 0bbc89ac58
2 changed files with 12 additions and 79 deletions

View File

@ -1,51 +0,0 @@
# This is a variant of https://opendev.org/opendev/base-jobs/src/branch/master/playbooks/docs/promote.yaml
# It publishes to a single directory.
- hosts: localhost
tasks:
- name: Check execution context
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
vars:
# download_artifact_job: provided by zuul job
download_artifact_api: "https://zuul.opendev.org/api/tenant/{{ zuul.tenant }}"
download_artifact_type:
- docs_archive
- docs_pdf
download_artifact_pipeline: gate
- name: Create working directory
file:
path: "{{ zuul.executor.work_root }}/docs"
state: directory
- name: Extract docs archive
unarchive:
src: "{{ zuul.executor.work_root }}/docs-html.tar.bz2"
dest: "{{ zuul.executor.work_root }}/docs"
- name: Find PDF files
find:
paths: "{{ zuul.executor.work_root }}/pdf/"
file_type: file
patterns: "*.pdf"
register: pdf_files
- name: Move found PDF file into doc dir
command: "mv {{ item.path }} {{ zuul.executor.work_root }}/docs"
with_items: "{{ pdf_files.files }}"
when: pdf_files.matched > 0
- name: Add fileserver
include_role:
name: add-fileserver
- hosts: "{{ fileserver.fqdn }}"
gather_facts: False
tasks:
- name: Upload docs to static site
synchronize:
src: "{{ zuul.executor.work_root }}/docs/"
dest: "{{ fileserver.path }}/{{ static_target }}"

View File

@ -315,53 +315,37 @@
- test-requirements.txt
- tox.ini
- job:
name: promote-openstack-specs-base
parent: opendev-promote-docs-base
abstract: true
protected: true
description: |
Base job to promote content to specs.openstack.org.
Jobs need to set the variable ``static_target`` for site to
publish to.
run: playbooks/static-docs/promote.yaml
vars:
download_artifact_job: build-openstack-specs-site
static_target: ""
roles:
- zuul: zuul/zuul-jobs
- zuul: openstack/openstack-zuul-jobs
secrets:
- name: fileserver
secret: site_specs_promote
- job:
name: promote-openstack-specs-site
parent: promote-openstack-specs-base
parent: promote-tox-docs-site-base
final: true
description: |
Publish OpenStack specs site to static.openstack.org specs/
Publish OpenStack specs index.
Publish specs index to
/afs/.openstack.org/project/specs.openstack.org/
This is a promote job for ``build-openstack-specs-site``.
allowed-projects:
- openstack/project-config
vars:
download_artifact_job: build-openstack-specs-site
static_target: ""
publish_site: "specs.openstack.org"
- job:
name: promote-openstack-specs
parent: promote-openstack-specs-base
parent: promote-tox-docs-site-base
final: true
description: |
Publish OpenStack specs project to static.openstack.org
specs/{{ zuul.project.name }}.
Publish OpenStack specs project.
Publish specs index to
/afs/.openstack.org/project/specs.openstack.org/{{ zuul.project.name }}.
This is a promote job for ``openstack-tox-docs``.
vars:
download_artifact_job: openstack-tox-docs
static_target: "{{ zuul.project.name }}"
publish_site: "specs.openstack.org/{{ zuul.project.name }}"
- job:
name: promote-tox-docs-infra