From 32cc5d7cc6f616d7a20c504154327f6ca07fded9 Mon Sep 17 00:00:00 2001 From: "zhu.boxiang" Date: Mon, 27 Sep 2021 15:44:03 +0800 Subject: [PATCH] feat: Publish source package into tarballs 1. Add post into zuul. So we publish source package into tarballs. 2. Update submodule for skyline-console Change-Id: I799e5658d0aca588d4f6b5b6ebcca218e1ca57d6 --- .zuul.yaml | 13 +++++++++ libs/skyline-console | 2 +- playbooks/python-tarball/post.yaml | 28 +++++++++++++++++++ playbooks/python-tarball/run.yaml | 43 ++++++++++++++++++++++++++++++ 4 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 playbooks/python-tarball/post.yaml create mode 100644 playbooks/python-tarball/run.yaml diff --git a/.zuul.yaml b/.zuul.yaml index ea77e6c..05b4550 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -42,6 +42,16 @@ python_version: 3.8 tox_envlist: lint +- job: + name: publish-skyline-python-branch-tarball + parent: publish-openstack-python-branch-tarball + description: | + Publish the results of the tox-tarball job to tarballs.openstack.org. + run: playbooks/python-tarball/run.yaml + post-run: playbooks/python-tarball/post.yaml + vars: + release_python: python3 + - project: check: jobs: @@ -53,3 +63,6 @@ - skyline-tox-unittest-py38 - skyline-tox-lint-py38 - skyline-functional-devstack + post: + jobs: + - publish-skyline-python-branch-tarball diff --git a/libs/skyline-console b/libs/skyline-console index 1b9c23e..7f273e4 160000 --- a/libs/skyline-console +++ b/libs/skyline-console @@ -1 +1 @@ -Subproject commit 1b9c23e5c286a263a673bfb0489053f296b42401 +Subproject commit 7f273e41c152a3eb1fd95d77cc8ca8442f918783 diff --git a/playbooks/python-tarball/post.yaml b/playbooks/python-tarball/post.yaml new file mode 100644 index 0000000..fdd48e9 --- /dev/null +++ b/playbooks/python-tarball/post.yaml @@ -0,0 +1,28 @@ +- 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/run.yaml b/playbooks/python-tarball/run.yaml new file mode 100644 index 0000000..d5ec6bc --- /dev/null +++ b/playbooks/python-tarball/run.yaml @@ -0,0 +1,43 @@ +- hosts: all + tasks: + - name: Install poetry!=1.1.8 + pip: + name: poetry!=1.1.8 + become: yes + - name: Add node repo + command: curl --silent --location https://rpm.nodesource.com/setup_12.x | sudo bash - + become: yes + - name: Install nodejs + apt: + name: nodejs + update_cache: yes + become: yes + - name: Update nodejs version + shell: + executable: /bin/bash + cmd: | + npm install -g n + n stable + become: yes + - name: Add yarn repo + shell: + executable: /bin/bash + cmd: | + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - + echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list + become: yes + - name: Install yarn + apt: + name: yarn + update_cache: yes + become: yes + + - name: Build tarball and wheel + shell: + executable: /bin/bash + cmd: | + make install + make package + args: + chdir: "src/{{ zuul.project.canonical_name }}" + become: yes \ No newline at end of file