Create publish-openstack-python(-branch)-tarball jobs

These 2 jobs will be used to copy release / branch tarballs to
tarballs.o.o.

Branch tarballs will only copy *.tar.gz, while release jobs will copy
both *.tar.gz and *.whl files.

Change-Id: Ic879302a2006b737ee4364cea067a00ebe198951
Depends-On: Ia79802dd386dbf1287af16a59985ce99a7dd4899
Depends-On: Ic7fc31a372de29a3a97ef84539faf3b0a1d6e181
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2017-08-04 16:58:44 -04:00
parent 0d5c11029a
commit f67d09d315
7 changed files with 91 additions and 1 deletions

View File

@ -0,0 +1,22 @@
- hosts: all
tasks:
# We only want to publish tar.gz file to tarballs.o.o. Find everything else
# and delete them.
- name: Find wheels in dist folder.
find:
file_type: file
paths: "src/{{ zuul.project.canonical_name }}/dist"
patterns: ^((?!tar\.gz).)*$
use_regex: yes
register: result
- name: Delete found files that don't match *.tar.gz.
file:
path: "{{ item.path }}"
state: absent
with_items: "{{ result.files }}"
- name: Rename tarball to branch specific name.
shell: "mv *.tar.gz {{ zuul.project.short_name }}-{{ zuul.branch }}.tar.gz"
args:
chdir: "src/{{ zuul.project.canonical_name }}/dist"

View File

@ -0,0 +1,30 @@
- hosts: all
roles:
- fetch-tox-output
post_tasks:
- name: Find tarballs and wheels in dist folder.
find:
file_type: file
paths: "src/{{ zuul.project.canonical_name }}/dist"
patterns: "*.tar.gz,*.whl"
register: result
- name: Display stat for tarballs and wheels.
stat:
path: "{{ item.path }}"
with_items: "{{ result.files }}"
- name: Ensure artifacts directory exists.
file:
path: "{{ zuul.executor.work_root }}/artifacts"
state: directory
delegate_to: localhost
- name: Collect tarball artifacts.
synchronize:
dest: "{{ zuul.executor.work_root }}/artifacts/"
mode: pull
src: "{{ item.path }}"
verify_host: true
with_items: "{{ result.files }}"

View File

@ -0,0 +1,9 @@
- hosts: all
roles:
- role: bindep
bindep_profile: test
bindep_dir: "src/{{ zuul.project.canonical_name }}"
# TODO(mordred) When we have site-local variables, these should go there
bindep_command: /usr/bindep-env/bin/bindep
bindep_fallback: /usr/local/jenkins/common_data/bindep-fallback.txt
- revoke-sudo

View File

@ -0,0 +1,10 @@
- hosts: all
pre_tasks:
- name: Ensure tox is installed
shell: type tox || pip install --user tox
roles:
- role: tox
tox_extra_args: -vv python setup.py sdist
- role: tox
tox_extra_args: -vv python setup.py bdist_wheel

View File

@ -8,3 +8,6 @@ ansible-lint
bashate>=0.2
sphinx>=1.5.1,<1.6.0 # BSD
oslosphinx>=4.7.0 # Apache-2.0
# zuul-jobs is required to supply the ansible roles for ansible-lint
-e git://git.openstack.org/openstack-infra/zuul-jobs#egg=zuul-jobs

View File

@ -23,7 +23,7 @@ commands = python setup.py build_sphinx
[testenv:linters]
setenv =
ANSIBLE_ROLES_PATH = {toxinidir}/roles
ANSIBLE_ROLES_PATH = {toxinidir}/roles:{envdir}/src/zuul-jobs/roles
whitelist_externals = bash
commands =
flake8 {posargs}

View File

@ -27,6 +27,22 @@
tox_environment:
UPPER_CONSTRAINTS_FILE: "{{ ansible_user_dir }}/src/git.openstack.org/openstack/requirements/upper-constraints.txt"
- job:
name: publish-openstack-python-tarball
parent: publish-openstack-tarball
description: |
Publish the results of the tox-tarball job to tarballs.openstack.org.
pre-run: playbooks/python-tarball/pre
run: playbooks/python-tarball/run
post-run: playbooks/python-tarball/post
- job:
name: publish-openstack-python-branch-tarball
parent: publish-openstack-python-tarball
description: |
Publish the results of the tox-tarball job to tarballs.openstack.org.
post-run: playbooks/python-branch-tarball/post
- project:
name: openstack-infra/openstack-zuul-jobs
check: