Merge "Create pypi_twine_executable"

This commit is contained in:
Zuul 2017-08-23 21:11:50 +00:00 committed by Gerrit Code Review
commit 91ab29ee40
3 changed files with 8 additions and 11 deletions

View File

@ -30,3 +30,8 @@ Upload python packages to PyPI
:default: src/{{ zuul.project.canonical_name }}/dist
Path containing artifacts to upload.
.. zuul:rolevar:: pypi_twine_executable
:default: twine
Path to twine executable.

View File

@ -2,3 +2,4 @@
pypi_path: "src/{{ zuul.project.canonical_name }}/dist"
pypi_repository: "{{ pypi_info.repository|default('pypi') }}"
pypi_repository_url: "{{ pypi_info.repository_url|default('https://pypi.python.org/pypi') }}"
pypi_twine_executable: twine

View File

@ -1,12 +1,3 @@
- name: Check for twine install
command: which twine
ignore_errors: yes
register: twine_command_which
- name: Ensure twine is installed
command: pip install --user twine
when: not twine_command_which|succeeded
- name: Install .pypirc configuration file
template:
dest: ~/.pypirc
@ -20,7 +11,7 @@
register: found_wheels
- name: Upload wheel with twine before tarballs
command: "twine upload -r {{ pypi_repository }} {{ item.path }}"
command: "{{ pypi_twine_executable }} upload -r {{ pypi_repository }} {{ item.path }}"
with_items: "{{ found_wheels.files }}"
when: found_wheels.matched|bool
@ -31,6 +22,6 @@
register: found_tarballs
- name: Upload tarballs with twine
command: "twine upload -r {{ pypi_repository }} {{ item.path }}"
command: "{{ pypi_twine_executable }} upload -r {{ pypi_repository }} {{ item.path }}"
with_items: "{{ found_tarballs.files }}"
when: found_tarballs.matched|bool