Add tox targets for managing dependencies

This commit is contained in:
Liam Young 2020-04-29 09:26:34 +00:00
parent b30ed57436
commit 1a0d76317e
6 changed files with 36 additions and 32 deletions

View File

@ -219,6 +219,14 @@ Alternatively, configuration can be provided as part of a bundle:
> **Warning**: As of the time of writing the workaround to set the CHAP
credentials via the esx cli is still needed.
## Development
The charm needs to pull in its dependencies before it can be deployed. To
pull in the dependency versions that correspond to this version of the
charm then run the `build` tox target.
To update all dependencies to their latest versions then run the `update-deps`
tox target.
<!-- LINKS -->

View File

@ -1,2 +1 @@
mod/charm-helpers
#file:///home/ubuntu/branches/ceph-iscsi/mod/charm-helpers

24
charm-init.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
UPDATE=""
while getopts ":u" opt; do
case $opt in
u) UPDATE=true;;
esac
done
git submodule update --init
if [[ -z "$UPDATE" ]]; then
pip install -t lib -r build-requirements.txt
else
git -C mod/operator pull origin master
git -C mod/ops-openstack pull origin master
git -C mod/charm-helpers pull origin master
pip install -t lib -r build-requirements.txt --upgrade
fi
ln -f -t lib -s ../mod/operator/ops
ln -f -t lib -s ../mod/interface-ceph-client/interface_ceph_client.py
ln -f -t lib -s ../mod/ops-openstack/ops_openstack.py
ln -f -t lib -s ../mod/ops-openstack/adapters.py

View File

@ -1,15 +0,0 @@
#!/bin/bash
rm -rf lib/*
pip install -t lib/ git+https://github.com/juju/charm-helpers.git
git submodule init
git submodule update
(cd lib; ln -s ../mod/operator/ops;)
(cd lib; ln -s ../mod/interface-ceph-client/interface_ceph_client.py;)
(cd lib; ln -s ../mod/ops-openstack/ops_openstack.py)
(cd lib; ln -s ../mod/ops-openstack/adapters.py)
(cd mod/interface-ceph-client; git pull origin master)
(cd mod/operator; git pull origin master)
(cd mod/ops-openstack; git pull origin master)

@ -1 +1 @@
Subproject commit 60c43f81e36139ab4044c185247eb27fe389bce6
Subproject commit 58ff602b29763172c39502de0fa64de965cfbea7

18
tox.ini
View File

@ -18,6 +18,7 @@ commands = stestr run --slowest {posargs}
whitelist_externals =
git
ln
charm-init.sh
passenv = HOME TERM CS_* OS_* TEST_*
deps = -r{toxinidir}/test-requirements.txt
@ -83,26 +84,13 @@ commands = {posargs}
basepython = python3
deps =
commands =
git submodule update --init
pip install -t lib -r build-requirements.txt
ln -f -t lib -s ../mod/operator/ops
ln -f -t lib -s ../mod/interface-ceph-client/interface_ceph_client.py
ln -f -t lib -s ../mod/ops-openstack/ops_openstack.py
ln -f -t lib -s ../mod/ops-openstack/adapters.py
./charm-init.sh
[testenv:update-deps]
basepython = python3
deps =
commands =
git submodule update --init
git -C mod/operator pull origin master
git -C mod/ops-openstack pull origin master
git -C mod/charm-helpers pull origin master
pip install -t lib -r build-requirements.txt --upgrade
ln -f -t lib -s ../mod/operator/ops
ln -f -t lib -s ../mod/interface-ceph-client/interface_ceph_client.py
ln -f -t lib -s ../mod/ops-openstack/ops_openstack.py
ln -f -t lib -s ../mod/ops-openstack/adapters.py
./charm-init.sh -u
[testenv:func-noop]
basepython = python3