project-config/playbooks/javascript/post-stackviz.yaml

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