project-config/playbooks/javascript/post-stackviz.yaml
Andreas Jaeger 15e763dc6a Move stackviz publish in-tree
The new job publish-openstack-stackviz-element is working now,
move the trigger in-tree and change the publish location, we do not need
the "-new" in the name anymore.

Content is published at:
https://tarballs.opendev.org/openstack/stackviz/dist/
The tarballs are equal, only difference is filenames of sources.

Mark the job to run only on master, since it publishes always to the
same location and each invocation overrides the file. This is a
safety measure.

Depends-On: https://review.opendev.org/710754
Change-Id: If9488d7c60b58f51a7a0a4bdf0740d16f61c241e
2020-03-03 16:03:24 +01:00

45 lines
1.3 KiB
YAML

- hosts: all
tasks:
- name: Rename tarball and move it to a subdir named dist as well
shell: |
mkdir dist
mv {{ zuul.project.short_name }}*.tar.gz dist/{{ zuul.project.short_name }}-latest.tar.gz
args:
executable: /bin/bash
chdir: "{{ zuul.project.src_dir }}/dist"
# 302 mkdir used in place of argument state=directory to file module
tags:
- skip_ansible_lint
- name: Ensure artifacts directory exists
file:
path: "{{ zuul.executor.work_root }}/artifacts"
state: directory
delegate_to: localhost
- name: Collect artifacts
synchronize:
dest: "{{ zuul.executor.work_root }}/artifacts/"
mode: pull
src: "{{ zuul.project.src_dir }}/dist/"
verify_host: true
- name: Find tarball tarball
find:
file_type: file
paths: "{{ zuul.project.src_dir }}/dist/"
patterns: "*.tar.gz"
register: result
- name: Return artifacts to Zuul
loop: "{{ result.files }}"
zuul_return:
data:
zuul:
artifacts:
- name: Javascript content archive
url: "artifacts/{{ item.path | basename }}"
metadata:
type: javascript_content