From 7b61aeee137bddda24603baf25657c94dd6e232f Mon Sep 17 00:00:00 2001 From: "zhu.boxiang" Date: Fri, 8 Oct 2021 15:17:11 +0800 Subject: [PATCH] Fix: Fail to publish package to tarballs 1. Use tox to make packages. 2. Change the way to install nodejs and yarn with nvm. 3. Update the skyline-console submodule Change-Id: I363ec0dcda428701be2260893ebe97aa3dd77b5f --- libs/skyline-console | 2 +- playbooks/python-tarball/pre.yaml | 32 ------------------------------- playbooks/python-tarball/run.yaml | 21 ++++++++++++++++++-- tox.ini | 8 +++++++- 4 files changed, 27 insertions(+), 36 deletions(-) diff --git a/libs/skyline-console b/libs/skyline-console index 7f273e4..ec49fff 160000 --- a/libs/skyline-console +++ b/libs/skyline-console @@ -1 +1 @@ -Subproject commit 7f273e41c152a3eb1fd95d77cc8ca8442f918783 +Subproject commit ec49fffbe5f50c1a0babad150a716b72a138fec4 diff --git a/playbooks/python-tarball/pre.yaml b/playbooks/python-tarball/pre.yaml index 688f098..5a3f34d 100644 --- a/playbooks/python-tarball/pre.yaml +++ b/playbooks/python-tarball/pre.yaml @@ -1,36 +1,4 @@ - 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 roles: # We use ensure-pip to make sure the wheel module is installed - ensure-pip diff --git a/playbooks/python-tarball/run.yaml b/playbooks/python-tarball/run.yaml index 3f13152..40b1038 100644 --- a/playbooks/python-tarball/run.yaml +++ b/playbooks/python-tarball/run.yaml @@ -1,10 +1,27 @@ - hosts: all tasks: + - name: Install tox, nvm, nodejs and yarn + shell: + executable: /bin/bash + cmd: | + # nvm + wget -P $HOME --tries=10 --retry-connrefused --waitretry=60 --no-dns-cache --no-cache https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh + bash $HOME/install.sh + . $HOME/.nvm/nvm.sh + # nodejs + NODE_VERSION=erbium + nvm install --lts=$NODE_VERSION + nvm alias default lts/$NODE_VERSION + nvm use default + # yarn + npm install -g yarn + # tox + pip3 install tox - name: Build tarball and wheel shell: executable: /bin/bash cmd: | - make install - make package + git submodule update --init + $HOME/.local/bin/tox -e package args: chdir: "src/{{ zuul.project.canonical_name }}" diff --git a/tox.ini b/tox.ini index 94f231d..bc605fb 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] minversion = 3.18.0 # python runtimes: https://governance.openstack.org/tc/reference/runtimes/ussuri.html -envlist = unittest-py38,lint,functional +envlist = unittest-py38,lint,functional,package skipsdist=true # this allows tox to infer the base python from the environment name # and override any basepython configured in this file @@ -33,3 +33,9 @@ whitelist_externals = echo commands = echo "TODO: Add functional test for skyline-apiserver" + +[testenv:package] +setenv = + IGNORE_JS = False +commands = + make package