zuul-jobs/roles/upload-pypi/tasks/main.yaml
Paul Belanger 40fd9474af
Move .pypirc into tmpfs
Store .pypirc in tmpfs since it contains secrets, we do this for both
gpg and ssh keys.

Change-Id: Ie85bd6daf8650547842de99d3f7260c49f6d623d
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-08-29 11:34:22 -04:00

36 lines
990 B
YAML

- name: Create .pypirc configuration file tempfile
tempfile:
state: file
register: _pypirc_tmp
- name: Create .pypirc configuration file
template:
dest: "{{ _pypirc_tmp.path }}"
mode: 0400
src: .pypirc.j2
- name: Find wheels to upload
find:
paths: "{{ pypi_path }}"
patterns: "*.whl"
register: found_wheels
- name: Upload wheel with twine before tarballs
command: "{{ pypi_twine_executable }} upload --config-file {{ _pypirc_tmp.path }} -r {{ pypi_repository }} {{ item.path }}"
with_items: "{{ found_wheels.files }}"
- name: Find tarballs to upload
find:
paths: "{{ pypi_path }}"
patterns: "*.tar.gz"
register: found_tarballs
- name: Upload tarballs with twine
command: "{{ pypi_twine_executable }} upload --config-file {{ _pypirc_tmp.path }} -r {{ pypi_repository }} {{ item.path }}"
with_items: "{{ found_tarballs.files }}"
- name: Delete .pypirc configuration file
file:
path: "{{ _pypirc_tmp.path }}"
state: absent