Use npm mirrors in tox jobs
Opendev runs a caching mirror for npm packages. Use it when running yarn install during tox tests. Due to the way yarn.lock files work at the moment we need to patch the lockfile on the fly to inject the mirror urls [1]. This can be handlel inside the pip.sh where we patch the lockfile, run yarn and reset it afterwards. [1] https://github.com/yarnpkg/yarn/issues/2566 Change-Id: Id1f2daac8327f3110e6beeb2d6391baccfd3ce34
This commit is contained in:
parent
d27b38ad6b
commit
9cb2e52c59
22
.zuul.yaml
22
.zuul.yaml
|
@ -238,22 +238,20 @@
|
|||
- playbooks/zuul-migrate/.*
|
||||
nodeset: ubuntu-xenial
|
||||
timeout: 4800 # 80 minutes
|
||||
vars:
|
||||
vars: &zuul_tox_vars
|
||||
test_setup_environment:
|
||||
ZUUL_TEST_ROOT: /tmp/zuul-test
|
||||
YARN_REGISTRY: "https://{{ zuul_site_mirror_fqdn }}:4443/registry.npmjs"
|
||||
tox_environment:
|
||||
ZUUL_TEST_ROOT: /tmp/zuul-test
|
||||
YARN_REGISTRY: "https://{{ zuul_site_mirror_fqdn }}:4443/registry.npmjs"
|
||||
- tox-py38:
|
||||
irrelevant-files:
|
||||
- zuul/cmd/migrate.py
|
||||
- playbooks/zuul-migrate/.*
|
||||
timeout: 4800 # 80 minutes
|
||||
nodeset: ubuntu-bionic
|
||||
vars:
|
||||
test_setup_environment:
|
||||
ZUUL_TEST_ROOT: /tmp/zuul-test
|
||||
tox_environment:
|
||||
ZUUL_TEST_ROOT: /tmp/zuul-test
|
||||
vars: *zuul_tox_vars
|
||||
- zuul-build-dashboard-openstack-whitelabel
|
||||
- zuul-build-dashboard-software-factory
|
||||
- zuul-build-dashboard-opendev
|
||||
|
@ -290,22 +288,14 @@
|
|||
- playbooks/zuul-migrate/.*
|
||||
nodeset: ubuntu-xenial
|
||||
timeout: 4800 # 80 minutes
|
||||
vars:
|
||||
test_setup_environment:
|
||||
ZUUL_TEST_ROOT: /tmp/zuul-test
|
||||
tox_environment:
|
||||
ZUUL_TEST_ROOT: /tmp/zuul-test
|
||||
vars: *zuul_tox_vars
|
||||
- tox-py38:
|
||||
irrelevant-files:
|
||||
- zuul/cmd/migrate.py
|
||||
- playbooks/zuul-migrate/.*
|
||||
timeout: 4800 # 80 minutes
|
||||
nodeset: ubuntu-bionic
|
||||
vars:
|
||||
test_setup_environment:
|
||||
ZUUL_TEST_ROOT: /tmp/zuul-test
|
||||
tox_environment:
|
||||
ZUUL_TEST_ROOT: /tmp/zuul-test
|
||||
vars: *zuul_tox_vars
|
||||
- zuul-build-dashboard
|
||||
- nodejs-run-lint:
|
||||
vars:
|
||||
|
|
12
tools/pip.sh
12
tools/pip.sh
|
@ -42,8 +42,18 @@ then
|
|||
mkdir -p zuul/web/static
|
||||
ln -sfn ../zuul/web/static web/build
|
||||
pushd web/
|
||||
yarn install
|
||||
if [[ -n "${YARN_REGISTRY}" ]]
|
||||
then
|
||||
echo "Using yarn registry: ${YARN_REGISTRY}"
|
||||
sed -i "s#https://registry.yarnpkg.com#${YARN_REGISTRY}#" yarn.lock
|
||||
fi
|
||||
yarn install --verbose
|
||||
yarn build
|
||||
if [[ -n "${YARN_REGISTRY}" ]]
|
||||
then
|
||||
echo "Resetting yarn registry"
|
||||
sed -i "s#${YARN_REGISTRY}#https://registry.yarnpkg.com#" yarn.lock
|
||||
fi
|
||||
popd
|
||||
fi
|
||||
pip install $*
|
||||
|
|
Loading…
Reference in New Issue