diff --git a/templates/parts/section-database b/templates/parts/section-database index 7046295..a4fa7e7 100644 --- a/templates/parts/section-database +++ b/templates/parts/section-database @@ -1,5 +1,5 @@ {% if shared_db.host -%} [database] -connection = {{ shared_db.type }}://{{ shared_db.username }}:{{ shared_db.password }}@{{ shared_db.host }}/{{ shared_db.database }}{% if database_ssl_ca %}?ssl_ca={{ database_ssl_ca }}{% if database_ssl_cert %}&ssl_cert={{ database_ssl_cert }}&ssl_key={{ database_ssl_key }}{% endif %}{% endif %} +connection = {{ shared_db.uri }} {% endif -%} diff --git a/tox.ini b/tox.ini index fe35626..a2c4984 100644 --- a/tox.ini +++ b/tox.ini @@ -1,24 +1,32 @@ [tox] skipsdist = True envlist = pep8 +toxworkdir = /tmp/tox [testenv] basepython = python2.7 setenv = VIRTUAL_ENV={envdir} PYTHONHASHSEED=0 TERM=linux - JUJU_REPOSITORY={toxinidir}/build + JUJU_REPOSITORY={envdir}/tmp/build passenv = http_proxy https_proxy install_command = pip install {opts} {packages} deps = -r{toxinidir}/requirements.txt -whitelist_externals = /bin/true /bin/echo +whitelist_externals = /bin/true /bin/echo /bin/mkdir /bin/ln [testenv:build] +# ``charm build`` refuses to output to a subdirectory to the source tree +# The gate check will look for and validate the built artifacts in the source +# tree. +# Build the artifats under /tmp and link back to source directory to alleviate. commands = /bin/echo 'WARNING: *build* target is for testing only.' - charm-build --log-level DEBUG -o {toxinidir}/build . + /bin/mkdir -p {envdir}/tmp + charm-build --log-level DEBUG -o {envdir}/tmp/build . + /bin/ln -s {envdir}/tmp/build/builds {envdir}/tmp/build/trusty + /bin/ln -s {envdir}/tmp/build {toxinidir}/build [testenv:venv] basepython = python3