From 3f0e3bb3cf85c94791c20ba0dc13532fc4f5a5ff Mon Sep 17 00:00:00 2001
From: blsaws <bryan.sullivan@att.com>
Date: Sun, 22 May 2016 12:01:53 -0700
Subject: Merge JOID and Apex installs.

JIRA: COPPER-2

Change-Id: I805644ff08d7a61a67469186890cd9920344025e
Signed-off-by: blsaws <bryan.sullivan@att.com>
---
 .../setup/install_congress_testserver_1.sh         | 127 -------------------
 .../setup/install_congress_testserver_2.sh         | 137 ---------------------
 2 files changed, 264 deletions(-)
 delete mode 100644 components/congress/test-webapp/setup/install_congress_testserver_1.sh
 delete mode 100644 components/congress/test-webapp/setup/install_congress_testserver_2.sh

(limited to 'components/congress/test-webapp/setup')

diff --git a/components/congress/test-webapp/setup/install_congress_testserver_1.sh b/components/congress/test-webapp/setup/install_congress_testserver_1.sh
deleted file mode 100644
index dfb2a4b..0000000
--- a/components/congress/test-webapp/setup/install_congress_testserver_1.sh
+++ /dev/null
@@ -1,127 +0,0 @@
-#!/bin/bash
-# Copyright 2015-2016 AT&T Intellectual Property, Inc
-#  
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#  
-# http://www.apache.org/licenses/LICENSE-2.0
-#  
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# What this is: script 1 of 2 for installation of a test server for Congress.
-# Status: this is a work in progress, under test.
-#
-# Prequisite: OPFNV installed per JOID or Apex installer
-# On jumphost:
-# - Congress installed through install_congress_1.sh
-# - ~/congress/env.sh created as part of Congress install (install_congress_1.sh)
-# How to use:
-#   $ source install_congress_testserver_1.sh  [<controller_hostname>]
-# If provided, <controller_hostname> is the name of the controller node in MAAS
-# (the parameter is not used for Apex-based installs)
-
-set -x
-
-echo "Install prerequisites"
-dist=`grep DISTRIB_ID /etc/*-release | awk -F '=' '{print $2}'`
-
-if [ "$dist" == "Ubuntu" ]; then
-  # Create and Activate the Container
-  # Earlier versions of the JOID installer installed lxc and created local templates
-  # but now we have to get the ubuntu template from the controller
-
-  if [ $# -lt 1 ]; then
-    echo 1>&2 "$0: arguments required <controller_hostname>"
-    set +x
-    return 2
-  fi
-
-  sudo apt-get install -y lxc
-
-  echo "Copy lxc-ubuntu container from the controller"
-  juju scp ubuntu@$1:/usr/share/lxc/templates/lxc-ubuntu ~/lxc-ubuntu
-  sudo cp ~/lxc-ubuntu /usr/share/lxc/templates/lxc-ubuntu
-
-  echo "Create the copper container"
-  sudo lxc-create -n copper -t /usr/share/lxc/templates/lxc-ubuntu -l DEBUG -- -b $USER ~/$USER
-
-  echo "Start copper"
-  sudo lxc-start -n copper -d
-  if (($? > 0)); then
-    echo Error starting copper lxc container
-    return
-  fi
-
-  echo "Get the CONGRESS_HOST value from env.sh"
-  source ~/congress/env.sh
-
-  echo "Get copper address"
-  sleep 5
-  export COPPER_HOST=""
-  while [ "$COPPER_HOST" == "" ]; do 
-    sleep 5
-    export COPPER_HOST=$(sudo lxc-info --name copper | grep IP | awk "/ / { print \$2 }")
-  done
-  echo COPPER_HOST = $COPPER_HOST
-
-  echo "Create the environment file"
-  cat <<EOF >~/congress/env.sh
-export COPPER_HOST=$COPPER_HOST
-export CONGRESS_HOST=$CONGRESS_HOST
-export KEYSTONE_HOST=$KEYSTONE_HOST
-export CEILOMETER_HOST=$CEILOMETER_HOST
-export CINDER_HOST=$CINDER_HOST
-export GLANCE_HOST=$GLANCE_HOST
-export NEUTRON_HOST=$NEUTRON_HOST
-export NOVA_HOST=$NOVA_HOST
-EOF
-
-  echo "Invoke install_congress_testserver_2.sh on copper"
-  ssh -t -x -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $USER@$COPPER_HOST "source ~/git/copper/components/congress/test-webapp/setup/install_congress_testserver_2.sh; exit"
-
-else
-  sudo tee /etc/yum.repos.d/docker.repo <<-'EOF'
-[dockerrepo]
-name=Docker Repository
-baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/
-enabled=1
-gpgcheck=1
-gpgkey=https://yum.dockerproject.org/gpg
-EOF
-  sudo service docker start
-
-  echo "Setup webapp files"
-  if [ ! -d /tmp/copper ]; then mkdir /tmp/copper; fi
-  if [ ! -d /tmp/copper/log ]; then mkdir /tmp/copper/log; fi
-  sudo scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no stack@192.0.2.1:/home/stack/congress/*.sh /tmp/copper
-  source /tmp/copper/env.sh
-  cp -r ~/git/copper/components/congress/test-webapp/* /tmp/copper/
-  if [ ! -d /tmp/copper/tests ]; then mkdir /tmp/copper/tests; fi
-  cp -r ~/git/copper/tests/* /tmp/copper/tests
-  echo "Point proxy.php to the Congress server"
-  source /tmp/copper/env.sh
-  sed -i -- "s/CONGRESS_HOST/$CONGRESS_HOST/g" /tmp/copper/www/proxy/index.php
-
-  echo "Start webapp container"
-  sudo docker build -t copper-webapp /tmp/copper
-  CID=$(sudo docker run -p 8080:80 -d copper-webapp)
-  CIP=$(sudo docker inspect $CID | grep IPAddress | cut -d '"' -f 4 | tail -1)
-  echo "Copper Webapp ID address: $CIP"
-
-  echo "Start Centos container"
-  sudo docker pull centos
-  echo "Attach to the Centos container"
-  echo "Once logged in, enter the command 'source /opt/copper/setup/install_congress_testserver_2.sh'"
-  sudo docker run -i -t -P --name copper-cli -v /tmp/copper:/opt/copper centos /bin/bash
-# sudo docker attach $CID
-# sudo docker run -it -P --name copper -v /tmp/copper:/opt/copper centos /opt/copper/setup/install_congress_testserver_2.sh
-# sudo docker ps -a
-fi
-
-set +x
-
diff --git a/components/congress/test-webapp/setup/install_congress_testserver_2.sh b/components/congress/test-webapp/setup/install_congress_testserver_2.sh
deleted file mode 100644
index 1f50be3..0000000
--- a/components/congress/test-webapp/setup/install_congress_testserver_2.sh
+++ /dev/null
@@ -1,137 +0,0 @@
-#!/bin/bash
-# Copyright 2015-2016 AT&T Intellectual Property, Inc
-#  
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#  
-# http://www.apache.org/licenses/LICENSE-2.0
-#  
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# What this is: script 2 of 2 for installation of a test server for Congress.
-# Status: this is a work in progress, under test.
-#
-# Prequisite: OPFNV installed per JOID or Apex installer
-# On jumphost:
-# - Congress installed through install_congress_1.sh
-# How to use:
-#   $ source install_congress_testserver_1.sh
-
-set -x
-
-echo "Setup OpenStack environment variables per your OPNFV install"
-source /opt/copper/env.sh
-source /opt/copper/admin-openrc.sh
-
-echo "Install prerequisites"
-dist=`grep DISTRIB_ID /etc/*-release | awk -F '=' '{print $2}'`
-
-if [ "$dist" == "Ubuntu" ]; then
-  echo "Update the base server"
-  set -x
-  apt-get update
-  #apt-get -y upgrade
-
-  echo "Install pip"
-  apt-get install -y python-pip
-
-  echo "Install java"
-  apt-get install -y default-jre
-
-  echo "Install other dependencies"
-  apt-get install -y git gcc python-dev libxml2 libxslt1-dev libzip-dev php5-curl
-
-  echo "Install Apache, PHP"
-  apt-get install -y apache2 php5 libapache2-mod-php5
-
-  echo "Setup the Congress Test Webappp"
-
-  echo "Copy the Apache config"
-  cp /opt/copper/www/ubuntu-apache2.conf /etc/apache2/apache2.conf
-
-  echo "Copy the webapp to the Apache root directory and fix permissions"
-  cp -R /opt/copper/www/html /var/www
-  chmod 755 /var/www/html -R
-
-  echo "Point copper.js to the trusty-copper server per your install"
-  sed -i -- "s/COPPER_HOST/$COPPER_HOST/g" /var/www/html/copper.js
-
-  echo "Point proxy.php to the Congress server per your install"
-  sed -i -- "s/CONGRESS_HOST/$CONGRESS_HOST/g" /var/www/html/proxy/index.php
-
-  echo "Make webapp log directory"
-  mkdir /tmp/copper/log
-
-  /etc/init.d/apache2 restart
-
-else
-  echo "Add epel repo"
-  yum install epel-release -y
-
-  echo "install pip"
-  yum install python-pip -y
-
-  echo "install other dependencies"
-  yum install apg git gcc libxml2 python-devel libzip-devel libxslt-devel -y
-
-fi
-
-echo "Install python dependencies"
-pip install --upgrade pip setuptools pbr tox
-
-echo "Install OpenStack client"
-mkdir /opt/copper/git
-cd /opt/copper/git
-git clone https://github.com/openstack/python-openstackclient.git
-cd python-openstackclient
-git checkout stable/liberty
-pip install -r requirements.txt
-pip install .
-
-echo "Install Congress client"
-cd /opt/copper/git
-git clone https://github.com/openstack/python-congressclient.git
-cd python-congressclient
-git checkout stable/liberty
-pip install -r requirements.txt
-pip install .
-
-echo "Install Glance client"
-cd /opt/copper/git
-git clone https://github.com/openstack/python-glanceclient.git
-cd python-glanceclient
-git checkout stable/liberty
-pip install -r requirements.txt
-pip install .
-
-echo "Install Neutron client"
-cd /opt/copper/git
-git clone https://github.com/openstack/python-neutronclient.git
-cd python-neutronclient
-git checkout stable/liberty
-pip install -r requirements.txt
-pip install .
-
-echo "Install Nova client"
-cd /opt/copper/git
-git clone https://github.com/openstack/python-novaclient.git
-cd python-novaclient
-git checkout stable/liberty
-pip install -r requirements.txt
-pip install .
-
-echo "Install Keystone client"
-cd /opt/copper/git
-git clone https://github.com/openstack/python-keystoneclient.git
-cd python-keystoneclient
-git checkout stable/liberty
-pip install -r requirements.txt
-pip install .
-
-set +x
-
-- 
cgit