Add setup.py for install with pip

Make possible installation with pip.
Change-Id: I8eec015142c4f29eadff0dac2781782b76dea308
This commit is contained in:
Sagi Shnaidman
2020-05-22 21:22:46 +03:00
parent f3610ad0e1
commit c9da50e7e7
5 changed files with 81 additions and 8 deletions

View File

@@ -97,14 +97,19 @@ then
fi
# install collections
tox -ebuild
ansible-galaxy collection build --force . --output-path ./build_artifact
ansible-galaxy collection install $(ls build_artifact/openstack-cloud-*) --force
if [[ -z "$PIP_INSTALL" ]]; then
tox -ebuild
ansible-galaxy collection install $(ls build_artifact/openstack-cloud-*) --force
TEST_COLLECTIONS_PATHS=${HOME}/.ansible/collections:$ANSIBLE_COLLECTIONS_PATHS
else
pip freeze | grep ansible-collections-openstack
TEST_COLLECTIONS_PATHS=$VIRTUAL_ENV/share/ansible/collections:$ANSIBLE_COLLECTIONS_PATHS
fi
# Discover openstackSDK version
SDK_VER=$(python -c "import openstack; print(openstack.version.__version__)")
pushd ci/
# run tests
ANSIBLE_COLLECTIONS_PATHS=${HOME}/.ansible/collections ansible-playbook \
ANSIBLE_COLLECTIONS_PATHS=$TEST_COLLECTIONS_PATHS ansible-playbook \
-vvv ./run-collection.yml \
-e "sdk_version=${SDK_VER} cloud=${CLOUD} image=${IMAGE} ${ANSIBLE_VARS}" \
${tag_opt}