From 7a9b11a6a2c630ff913c97e24f66a53b76b31506 Mon Sep 17 00:00:00 2001 From: "zhu.boxiang" Date: Sat, 9 Oct 2021 12:07:57 +0800 Subject: [PATCH] Fix: Only keep one tar.gz and whl package under dist 1. Add all tar.gz packages into one tar.gz package. 2. Keep one whl package under dist. Be carefull, we should not use the whl package, because it is only for the zuul job to publish. 3. Remove post and pre yaml files Change-Id: I6d59bd5d6e4fd62f0b2f9c8d40d634e0ee01e327 --- .zuul.yaml | 2 -- playbooks/python-tarball/post.yaml | 28 ---------------------------- playbooks/python-tarball/pre.yaml | 5 ----- playbooks/python-tarball/run.yaml | 23 ++++++++++++++++++++--- 4 files changed, 20 insertions(+), 38 deletions(-) delete mode 100644 playbooks/python-tarball/post.yaml delete mode 100644 playbooks/python-tarball/pre.yaml diff --git a/.zuul.yaml b/.zuul.yaml index c03f412..28ae856 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -47,9 +47,7 @@ parent: publish-openstack-artifacts description: | 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/playbooks/python-tarball/post.yaml b/playbooks/python-tarball/post.yaml deleted file mode 100644 index 80630e7..0000000 --- a/playbooks/python-tarball/post.yaml +++ /dev/null @@ -1,28 +0,0 @@ -- hosts: all - roles: - - fetch-python-sdist-output - pre_tasks: - - 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" - - "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" - - "skyline-apiserver" - - "skyline-config" - - "skyline-console" - - "skyline-log" - - "skyline-nginx" - - "skyline-policy-manager" diff --git a/playbooks/python-tarball/pre.yaml b/playbooks/python-tarball/pre.yaml deleted file mode 100644 index 5a3f34d..0000000 --- a/playbooks/python-tarball/pre.yaml +++ /dev/null @@ -1,5 +0,0 @@ -- hosts: all - roles: - # We use ensure-pip to make sure the wheel module is installed - - ensure-pip - - revoke-sudo diff --git a/playbooks/python-tarball/run.yaml b/playbooks/python-tarball/run.yaml index 9352cd2..d59f0ea 100644 --- a/playbooks/python-tarball/run.yaml +++ b/playbooks/python-tarball/run.yaml @@ -26,8 +26,15 @@ $HOME/.local/bin/tox -e package args: chdir: "src/{{ zuul.project.canonical_name }}" - - name: Move all tar.gz and wheel packages into dist - shell: "mv libs/{{ item }}/dist/* dist/" + - name: Remove the invalid tar.gz packages + shell: + executable: /bin/bash + cmd: | + rm -rf *.tar.gz + args: + chdir: "src/{{ zuul.project.canonical_name }}/dist" + - name: Move all tar.gz packages into dist + shell: "mv libs/{{ item }}/dist/*.tar.gz dist/" args: chdir: "src/{{ zuul.project.canonical_name }}" with_items: @@ -37,4 +44,14 @@ - "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 + args: + chdir: "src/{{ zuul.project.canonical_name }}/dist"