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:
parent
0d5c11029a
commit
f67d09d315
|
@ -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"
|
|
@ -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 }}"
|
|
@ -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
|
|
@ -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
|
|
@ -8,3 +8,6 @@ ansible-lint
|
||||||
bashate>=0.2
|
bashate>=0.2
|
||||||
sphinx>=1.5.1,<1.6.0 # BSD
|
sphinx>=1.5.1,<1.6.0 # BSD
|
||||||
oslosphinx>=4.7.0 # Apache-2.0
|
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
|
||||||
|
|
2
tox.ini
2
tox.ini
|
@ -23,7 +23,7 @@ commands = python setup.py build_sphinx
|
||||||
|
|
||||||
[testenv:linters]
|
[testenv:linters]
|
||||||
setenv =
|
setenv =
|
||||||
ANSIBLE_ROLES_PATH = {toxinidir}/roles
|
ANSIBLE_ROLES_PATH = {toxinidir}/roles:{envdir}/src/zuul-jobs/roles
|
||||||
whitelist_externals = bash
|
whitelist_externals = bash
|
||||||
commands =
|
commands =
|
||||||
flake8 {posargs}
|
flake8 {posargs}
|
||||||
|
|
16
zuul.yaml
16
zuul.yaml
|
@ -27,6 +27,22 @@
|
||||||
tox_environment:
|
tox_environment:
|
||||||
UPPER_CONSTRAINTS_FILE: "{{ ansible_user_dir }}/src/git.openstack.org/openstack/requirements/upper-constraints.txt"
|
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:
|
- project:
|
||||||
name: openstack-infra/openstack-zuul-jobs
|
name: openstack-infra/openstack-zuul-jobs
|
||||||
check:
|
check:
|
||||||
|
|
Loading…
Reference in New Issue