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/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