Fix openstack-infra publishing

Add native zuul v3 job to publish index file of
openstack-infra/publications.
Run the post job on all branches, so that a change to the master branch
regenerates the index file.

Add native zuul v3 job to publish a specific publication from
openstack-infra/publications.
Use the job for the project.

Needed-By: I190b34217c87d45e13bca18c7e121189323b698f
Change-Id: I6da66649726a1a96d06d7ca643adeec8ea8649eb
This commit is contained in:
Andreas Jaeger 2017-10-28 15:49:23 +02:00
parent 63750b62f6
commit f66101a4bf
6 changed files with 106 additions and 5 deletions

View File

@ -0,0 +1,6 @@
- hosts: all
tasks:
- name: Run make-index
command: ./make-index
args:
chdir: '{{ zuul.project.src_dir }}'

View File

@ -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 }}'

View File

@ -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

View File

@ -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

View File

@ -389,6 +389,44 @@
- secret: afsdocs_secret - secret: afsdocs_secret
name: afs 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: - job:
name: publish-openstack-python-branch-tarball name: publish-openstack-python-branch-tarball
parent: publish-openstack-artifacts parent: publish-openstack-artifacts

View File

@ -1129,15 +1129,14 @@
- noop-jobs - noop-jobs
post: post:
jobs: jobs:
- legacy-infra-publications-publish: - publish-infra-publications:
branches: ^(?!master).*$
- legacy-infra-publications-publish-index:
branches: ^(?!master).*$ branches: ^(?!master).*$
- publish-infra-publications-index
tag: tag:
jobs: jobs:
- legacy-infra-publications-publish: - publish-infra-publications:
branches: ^(?!master).*$ branches: ^(?!master).*$
- legacy-infra-publications-publish-index: - publish-infra-publications-index:
branches: ^(?!master).*$ branches: ^(?!master).*$
- project: - project: