diff --git a/.zuul.yaml b/.zuul.yaml index 4f81fe6..c03f412 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -49,6 +49,7 @@ Publish the results tar.gz and whl packages to tarballs.openstack.org. pre-run: playbooks/python-tarball/pre.yaml run: playbooks/python-tarball/run.yaml + post-run: playbooks/python-tarball/post.yaml vars: release_python: python3 diff --git a/libs/skyline-console b/libs/skyline-console index ec49fff..6b1f119 160000 --- a/libs/skyline-console +++ b/libs/skyline-console @@ -1 +1 @@ -Subproject commit ec49fffbe5f50c1a0babad150a716b72a138fec4 +Subproject commit 6b1f119db723343040c43d2ccba31d54e39f2207 diff --git a/playbooks/python-tarball/post.yaml b/playbooks/python-tarball/post.yaml new file mode 100644 index 0000000..c17a333 --- /dev/null +++ b/playbooks/python-tarball/post.yaml @@ -0,0 +1,35 @@ +- hosts: all + 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: "{{ zj_tarball_wheel.path }}" + with_items: "{{ result.files }}" + loop_control: + loop_var: zj_tarball_wheel + + - name: Ensure artifacts directory exists + file: + path: "{{ zuul.executor.work_root }}/artifacts" + state: directory + mode: 0755 + delegate_to: localhost + + - name: Collect artifacts + synchronize: + dest: "{{ zuul.executor.work_root }}/artifacts/" + mode: pull + src: "{{ zj_artifact.path }}" + verify_host: true + owner: no + group: no + with_items: "{{ result.files }}" + loop_control: + loop_var: zj_artifact + diff --git a/playbooks/python-tarball/run.yaml b/playbooks/python-tarball/run.yaml index d59f0ea..958bec2 100644 --- a/playbooks/python-tarball/run.yaml +++ b/playbooks/python-tarball/run.yaml @@ -17,6 +17,7 @@ npm install -g yarn # tox pip3 install tox + - name: Build tarball and wheel shell: executable: /bin/bash @@ -26,15 +27,17 @@ $HOME/.local/bin/tox -e package args: chdir: "src/{{ zuul.project.canonical_name }}" - - name: Remove the invalid tar.gz packages + + - name: Remove the invalid tar.gz and whl packages shell: executable: /bin/bash cmd: | - rm -rf *.tar.gz + rm -rf * args: chdir: "src/{{ zuul.project.canonical_name }}/dist" - - name: Move all tar.gz packages into dist - shell: "mv libs/{{ item }}/dist/*.tar.gz dist/" + + - name: Move all tar.gz and whl packages into dist + shell: "mv libs/{{ item }}/dist/* dist/" args: chdir: "src/{{ zuul.project.canonical_name }}" with_items: @@ -44,14 +47,28 @@ - "skyline-log" - "skyline-nginx" - "skyline-policy-manager" - - name: All tar.gz into skyline.tar.gz - shell: - executable: /bin/bash - cmd: | - mkdir -p packages - mv *.tar.gz packages - mv packages skyline-apiserver - tar -czf skyline-apiserver.tar.gz skyline-apiserver - rm -rf skyline-apiserver + + - name: Rename whl files to branch specific name + shell: "mv {{ item }}*.whl {{ item }}-{{ zuul.branch | replace('/', '-') }}.whl" args: chdir: "src/{{ zuul.project.canonical_name }}/dist" + with_items: + - "skyline_apiserver" + - "skyline_config" + - "skyline_console" + - "skyline_log" + - "skyline_nginx" + - "skyline_policy_manager" + + - name: Rename tar.gz files to branch specific name + shell: "mv {{ item }}*.tar.gz {{ item }}-{{ zuul.branch | replace('/', '-') }}.tar.gz" + args: + chdir: "src/{{ zuul.project.canonical_name }}/dist" + with_items: + - "skyline-apiserver" + - "skyline-config" + - "skyline-console" + - "skyline-log" + - "skyline-nginx" + - "skyline-policy-manager" +