#!/bin/bash
function write_config {
cat <<-EOF > apps.yaml
mysql:
dataset-size: 50%
max-connections: 20000
root-password: changeme
sst-password: changeme
keystone:
admin-password: openstack
admin-token: ubuntutesting
openstack-origin: cloud:trusty-liberty
congress:
source-branch: stable/liberty
EOF
}
function clean {
rm -rf trusty
rm -rf charm-congress
}
function collect {
mkdir -p trusty;
(cd trusty; git clone -b bug/congress-fix git@github.com:gnuoy/charm-keystone.git keystone; )
git clone git@github.com:gnuoy/charm-congress.git
}
function build {
export http_proxy=http://squid.internal:3128
(cd charm-congress; charm build -s trusty -obuild src)
unset http_proxy
mv charm-congress/build/trusty/congress trusty
}
function deploy {
juju deploy --config apps.yaml cs:trusty/percona-cluster mysql
juju deploy --config apps.yaml local:trusty/keystone
juju deploy --config apps.yaml local:trusty/congress
juju deploy cs:trusty/rabbitmq-server
}
function relations {
juju add-relation keystone mysql
juju add-relation congress mysql
juju add-relation congress keystone
juju add-relation congress rabbitmq-server
}
function congress_test {
. ~/openstack-charm-testing/novarc
openstack congress datasource create neutronv2 "neutronv2" \
--config username=$OS_USERNAME \
--config tenant_name=$OS_TENANT_NAME \
--config password=$OS_PASSWORD \
--config auth_url=$OS_AUTH_URL
}
clean
collect
build
write_config
deploy
relations