diff options
author | 2016-02-19 16:56:33 -0800 | |
---|---|---|
committer | 2016-02-19 16:56:33 -0800 | |
commit | 4db35382301e5c78cf9cd527c882e5888b99eb56 (patch) | |
tree | a8145a7af061066a5972e11314f606bfe9f0c553 | |
parent | 25e123906677f766828c823e3594648b821f3120 (diff) |
Various improvements supporting automated testserver install.
JIRA: COPPER-4
Change-Id: Ib0ef2ef57d536b34791bec3551baa7f91e8d7b3d
Signed-off-by: blsaws <bs3131@att.com>
-rw-r--r-- | components/congress/test-webapp/setup/install_congress_testserver_1.sh | 24 | ||||
-rw-r--r-- | components/congress/test-webapp/setup/install_congress_testserver_2.sh | 30 |
2 files changed, 35 insertions, 19 deletions
diff --git a/components/congress/test-webapp/setup/install_congress_testserver_1.sh b/components/congress/test-webapp/setup/install_congress_testserver_1.sh index 50f6882..1309d7a 100644 --- a/components/congress/test-webapp/setup/install_congress_testserver_1.sh +++ b/components/congress/test-webapp/setup/install_congress_testserver_1.sh @@ -34,24 +34,40 @@ # Earlier versions of the JOID installer installed lxc and created local templates # but now we have to get the ubuntu template from the controller set -x + sudo apt-get install -y lxc juju scp ubuntu@node1-control:/usr/share/lxc/templates/lxc-ubuntu ~/lxc-ubuntu sudo cp ~/lxc-ubuntu /usr/share/lxc/templates/lxc-ubuntu sudo lxc-create -n trusty-copper -t /usr/share/lxc/templates/lxc-ubuntu -l DEBUG -- -b opnfv ~/opnfv sudo lxc-start -n trusty-copper -d -sudo lxc-info --name trusty-copper if (($? > 0)); then + echo Error starting trusty-copper lxc container return fi + +# Get the copper server address +sleep 5 export COPPER_HOST="" while [ "$COPPER_HOST" == "" ]; do sleep 5 export COPPER_HOST=$(sudo lxc-info --name trusty-copper | grep IP | awk "/ / { print \$2 }") done echo COPPER_HOST = $COPPER_HOST -echo export COPPER_HOST=$COPPER_HOST >>~/env.sh -ssh -t -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no opnfv@$COPPER_HOST "source ~/git/copper/components/congress/test-webapp/setup/install_congress_testserver_2.sh; exit" <<EOF -$1 + +# Create the environment file +cat <<EOF >~/env.sh +export COPPER_HOST=$COPPER_HOST +export CONGRESS_HOST=$CONGRESS_HOST +export KEYSTONE_HOST=$(juju status --format=short | awk "/keystone\/0/ { print \$3 }") +export CEILOMETER_HOST=$(juju status --format=short | awk "/ceilometer\/0/ { print \$3 }") +export CINDER_HOST=$(juju status --format=short | awk "/cinder\/0/ { print \$3 }") +export GLANCE_HOST=$(juju status --format=short | awk "/glance\/0/ { print \$3 }") +export NEUTRON_HOST=$(juju status --format=short | awk "/neutron-api\/0/ { print \$3 }") +export NOVA_HOST=$(juju status --format=short | awk "/nova-cloud-controller\/0/ { print \$3 }") EOF + +# Invoke install_congress_testserver_2.sh +ssh -t -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no opnfv@$COPPER_HOST "source ~/git/copper/components/congress/test-webapp/setup/install_congress_testserver_2.sh; exit" + set +x # </code> diff --git a/components/congress/test-webapp/setup/install_congress_testserver_2.sh b/components/congress/test-webapp/setup/install_congress_testserver_2.sh index 01c9ce1..bf01b74 100644 --- a/components/congress/test-webapp/setup/install_congress_testserver_2.sh +++ b/components/congress/test-webapp/setup/install_congress_testserver_2.sh @@ -18,32 +18,30 @@ # # Prequisite: OPFNV install per https://wiki.opnfv.org/copper/academy/joid # On jumphost: -# - Congress installed through install_congress_1/2/3/4.sh -# - ~/env.sh created as part of Congress install (install_congress_3.sh) +# - Congress installed through install_congress_1/2.sh # How to use: # Install OPNFV per https://wiki.opnfv.org/copper/academy/joid # $ source ~/git/copper/tests/setup/install_congress_testserver_1.sh -# === Configure the test server === -# <code> +# Setup OpenStack environment variables per your OPNFV install +source ~/env.sh +source ~/admin-openrc.sh <<EOF +openstack +EOF +# Update the base server +set -x sudo apt-get update -sudo apt-get upgrade -y +sudo apt-get -y upgrade # Install pip -sudo apt-get install python-pip -y +sudo apt-get install -y python-pip # Install java -sudo apt-get install default-jre -y +sudo apt-get install -y default-jre # Install other dependencies -sudo apt-get install git gcc python-dev libxml2 libxslt1-dev libzip-dev php5-curl -y - -# Setup OpenStack environment variables per your OPNFV install -source ~/env.sh -source ~/admin-openrc.sh <<EOF -openstack -EOF +sudo apt-get install -y git gcc python-dev libxml2 libxslt1-dev libzip-dev php5-curl # Install and test OpenStack client mkdir ~/coppertest @@ -132,4 +130,6 @@ chmod 777 ~/coppertest/logs # Restart Apache sudo service apache2 restart -# </code> + +set +x + |