diff --git a/README.md b/README.md index 62c03c4..3b6730f 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/build-requirements.txt b/build-requirements.txt index 81ba415..1b770a7 100644 --- a/build-requirements.txt +++ b/build-requirements.txt @@ -1,2 +1 @@ mod/charm-helpers -#file:///home/ubuntu/branches/ceph-iscsi/mod/charm-helpers diff --git a/charm-init.sh b/charm-init.sh new file mode 100755 index 0000000..6437235 --- /dev/null +++ b/charm-init.sh @@ -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 diff --git a/charm-prep.sh b/charm-prep.sh deleted file mode 100755 index 0f29b41..0000000 --- a/charm-prep.sh +++ /dev/null @@ -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) diff --git a/mod/operator b/mod/operator index 60c43f8..58ff602 160000 --- a/mod/operator +++ b/mod/operator @@ -1 +1 @@ -Subproject commit 60c43f81e36139ab4044c185247eb27fe389bce6 +Subproject commit 58ff602b29763172c39502de0fa64de965cfbea7 diff --git a/tox.ini b/tox.ini index 4c3de17..cf9f42d 100644 --- a/tox.ini +++ b/tox.ini @@ -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