Browse Source

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
changes/10/516010/13
Andreas Jaeger 4 years ago
parent
commit
f66101a4bf
  1. 6
      playbooks/publications-index/run.yaml
  2. 22
      playbooks/publications/run.yaml
  3. 20
      playbooks/publish/publications-index.yaml
  4. 16
      playbooks/publish/publications.yaml
  5. 38
      zuul.d/jobs.yaml
  6. 9
      zuul.d/projects.yaml

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

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

20
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

16
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

38
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

9
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:

Loading…
Cancel
Save