From 8d0118e42e6f845da85fe8ed23d01a706cd6d279 Mon Sep 17 00:00:00 2001 From: blsaws Date: Sun, 22 May 2016 19:56:31 -0700 Subject: Various design improvements. JIRA: COPPER-4 Change-Id: Ie1ebf77dfd707eb784627c0b4abd4210e85c6c2d Signed-off-by: blsaws --- .../congress/test-webapp/setup/clean_congress_testserver.sh | 2 +- .../test-webapp/setup/install_congress_cli_test_environment.sh | 4 ++-- .../congress/test-webapp/setup/install_congress_testserver.sh | 4 ++-- .../congress/test-webapp/setup/restart_congress_testserver.sh | 2 +- components/congress/test-webapp/www/copper.js | 2 +- components/congress/test-webapp/www/proxy/index.php | 10 +++++----- 6 files changed, 12 insertions(+), 12 deletions(-) (limited to 'components/congress/test-webapp') diff --git a/components/congress/test-webapp/setup/clean_congress_testserver.sh b/components/congress/test-webapp/setup/clean_congress_testserver.sh index 4148751..fd41e43 100755 --- a/components/congress/test-webapp/setup/clean_congress_testserver.sh +++ b/components/congress/test-webapp/setup/clean_congress_testserver.sh @@ -21,7 +21,7 @@ # How to use: # Retrieve the testserver uninstall script as below # $ wget https://git.opnfv.org/cgit/copper/plain/components/congress/test-webapp/setup/clean_congress_testserver.sh -# $ source clean_congress_testserver.sh +# $ bash clean_congress_testserver.sh set -x echo "Get copper-webapp container ID" CID=$(sudo docker ps | awk "/copper-webapp/ { print \$1 }") diff --git a/components/congress/test-webapp/setup/install_congress_cli_test_environment.sh b/components/congress/test-webapp/setup/install_congress_cli_test_environment.sh index c072a02..48f33fa 100644 --- a/components/congress/test-webapp/setup/install_congress_cli_test_environment.sh +++ b/components/congress/test-webapp/setup/install_congress_cli_test_environment.sh @@ -25,7 +25,7 @@ # Retrieve the copper install script as below, optionally specifying the # branch to use as a URL parameter, e.g. ?h=stable%2Fbrahmaputra # $ wget https://git.opnfv.org/cgit/copper/plain/components/congress/test-webapp/setup/install_congress_cli_test_environment.sh -# $ source install_congress_cli_test_environment.sh [copper-branch] +# $ bash install_congress_cli_test_environment.sh [copper-branch] # optionally specifying the branch identifier to use for copper set -x @@ -37,7 +37,7 @@ if [ ! -d /tmp/copper ]; then mkdir /tmp/copper; fi dist=`grep DISTRIB_ID /etc/*-release | awk -F '=' '{print $2}'` if [ "$dist" == "Ubuntu" ]; then cp ~/congress/env.sh /tmp/copper/ - cp ~/congress/admin-openrc.sh /tmp/copper/ + cp ~/admin-openrc.sh /tmp/copper/ else echo "Copy copper environment files" sudo scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no stack@192.0.2.1:/home/stack/congress/*.sh /tmp/copper diff --git a/components/congress/test-webapp/setup/install_congress_testserver.sh b/components/congress/test-webapp/setup/install_congress_testserver.sh index a513929..9db8167 100644 --- a/components/congress/test-webapp/setup/install_congress_testserver.sh +++ b/components/congress/test-webapp/setup/install_congress_testserver.sh @@ -25,7 +25,7 @@ # Retrieve the copper install script as below, optionally specifying the # branch to use as a URL parameter, e.g. ?h=stable%2Fbrahmaputra # $ wget https://git.opnfv.org/cgit/copper/plain/components/congress/test-webapp/setup/install_congress_testserver.sh -# $ source install_congress_testserver.sh [copper-branch] +# $ bash install_congress_testserver.sh [copper-branch] # optionally specifying the branch identifier to use for copper set -x @@ -89,7 +89,7 @@ sed -i -- "s/CONGRESS_HOST/$CONGRESS_HOST/g" /tmp/copper/copper/components/congr echo "Start webapp container" sudo docker build -t copper-webapp /tmp/copper/copper/components/congress/test-webapp/ -CID=$(sudo docker run -p 8080:80 -d copper-webapp) +CID=$(sudo docker run -v /tmp/copper/log:/tmp -p 8080:80 -d copper-webapp) CIP=$(sudo docker inspect $CID | grep IPAddress | cut -d '"' -f 4 | tail -1) echo "Copper Webapp IP address: $CIP" diff --git a/components/congress/test-webapp/setup/restart_congress_testserver.sh b/components/congress/test-webapp/setup/restart_congress_testserver.sh index b67abaf..97e585b 100755 --- a/components/congress/test-webapp/setup/restart_congress_testserver.sh +++ b/components/congress/test-webapp/setup/restart_congress_testserver.sh @@ -23,7 +23,7 @@ # - Congress installed through install_congress_1.sh # - ~/env.sh created as part of Congress install (install_congress_1.sh) # How to use: -# $ source restart_congress_testserver.sh +# $ bash restart_congress_testserver.sh set -x diff --git a/components/congress/test-webapp/www/copper.js b/components/congress/test-webapp/www/copper.js index a9656c1..f32c139 100644 --- a/components/congress/test-webapp/www/copper.js +++ b/components/congress/test-webapp/www/copper.js @@ -13,7 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -var origin = "http://localhost:2257/proxy/?~url="; +var origin = "http://localhost:8080/proxy/?~url="; var dataSources = []; var datasource_tables = []; var datasource_rows = []; diff --git a/components/congress/test-webapp/www/proxy/index.php b/components/congress/test-webapp/www/proxy/index.php index b8e954d..8a2833a 100644 --- a/components/congress/test-webapp/www/proxy/index.php +++ b/components/congress/test-webapp/www/proxy/index.php @@ -23,7 +23,7 @@ if ($method == 'OPTIONS') { exit(); } -$url = "http://CONGRESS_HOST:1789".$_GET['~url']; +$url = "http://192.168.10.117:1789".$_GET['~url']; $curlop = curl_init(); curl_setopt($curlop, CURLOPT_URL, $url); curl_setopt($curlop, CURLOPT_CUSTOMREQUEST, $method); @@ -43,15 +43,15 @@ $response = curl_exec($curlop); $req_time=time(); $info = curl_getinfo($curlop); -$result = file_put_contents("/tmp/copper/log/".date('ymd').".log", "proxy.php, ".$req_time.", ".$url.", ".$type.", ".$body."\n",FILE_APPEND); -//if ($result === false) $response = "PHP error in index.php"; +$result = file_put_contents("/tmp/".date('ymd').".log", "proxy.php, ".$req_time.", ".$url.", ".$type.", ".$body."\n",FILE_APPEND); +if ($result === false) $response = "PHP error in index.php"; $responseCode=curl_getinfo($curlop,CURLINFO_HTTP_CODE); $header_size = curl_getinfo($response, CURLINFO_HEADER_SIZE); $header = substr($response, 0, $header_size); $type = curl_getinfo($curlop,CURLINFO_CONTENT_TYPE); $body = substr($response, $header_size); -$result = file_put_contents("/tmp/copper/log/".date('ymd').".log", "proxy.php, ".$req_time.", ".$responseCode.", ".$type.", ".$header.", ".$body."\n",FILE_APPEND); -//if ($result === false) $response = "PHP error in index.php"; +$result = file_put_contents("/tmp/".date('ymd').".log", "proxy.php, ".$req_time.", ".$responseCode.", ".$type.", ".$header.", ".$body."\n",FILE_APPEND); +if ($result === false) $response = "PHP error in index.php"; // header("Location: ".$url); header("Content-Type: ".$type); -- cgit 1.2.3-korg