You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by im...@apache.org on 2015/02/06 06:33:58 UTC

stratos git commit: Fixing script_path finding statement in single cartridge application

Repository: stratos
Updated Branches:
  refs/heads/master b9271e443 -> 0236c2491


Fixing script_path finding statement in single cartridge application


Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/0236c249
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/0236c249
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/0236c249

Branch: refs/heads/master
Commit: 0236c249182782638f325a3de432fdbd91e38044
Parents: b9271e4
Author: Imesh Gunaratne <im...@apache.org>
Authored: Fri Feb 6 11:03:41 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Fri Feb 6 11:03:52 2015 +0530

----------------------------------------------------------------------
 .../single-cartridge/scripts/common/deploy.sh   | 19 ++++++------------
 .../single-cartridge/scripts/ec2/deploy.sh      | 19 ++++++------------
 .../scripts/kubernetes/deploy.sh                | 21 +++++++-------------
 .../single-cartridge/scripts/mock/deploy.sh     | 15 +++++---------
 .../scripts/openstack/deploy.sh                 | 19 ++++++------------
 5 files changed, 30 insertions(+), 63 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/stratos/blob/0236c249/samples/applications/single-cartridge/scripts/common/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-cartridge/scripts/common/deploy.sh b/samples/applications/single-cartridge/scripts/common/deploy.sh
index abb47a2..8f8a1b6 100755
--- a/samples/applications/single-cartridge/scripts/common/deploy.sh
+++ b/samples/applications/single-cartridge/scripts/common/deploy.sh
@@ -4,20 +4,13 @@ iaas=$1
 host_ip="localhost"
 host_port=9443
 
-script_path=""
-if [ "$(uname)" == "Darwin" ]; then
-    script_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
-    script_path="$( cd -P "$( dirname "$SOURCE" )" && pwd )/`dirname $0`"
-else
-   echo "Unknown operating system"
-   exit
-fi
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
 
-artifacts_path="${script_path}/../../artifacts"
-iaas_artifacts_path="${script_path}/../../artifacts/${iaas}"
-cartridges_path="${script_path}/../../../../cartridges/${iaas}"
-cartridges_groups_path="${script_path}/../../../../cartridges-groups"
+artifacts_path=`cd "${script_path}/../../artifacts"; pwd`
+iaas_artifacts_path=`cd "${script_path}/../../artifacts/${iaas}"; pwd`
+cartridges_path=`cd "${script_path}/../../../../cartridges/${iaas}"; pwd`
+cartridges_groups_path=`cd "${script_path}/../../../../cartridges-groups"; pwd`
 
 set -e
 

http://git-wip-us.apache.org/repos/asf/stratos/blob/0236c249/samples/applications/single-cartridge/scripts/ec2/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-cartridge/scripts/ec2/deploy.sh b/samples/applications/single-cartridge/scripts/ec2/deploy.sh
index 16c09f1..6259582 100755
--- a/samples/applications/single-cartridge/scripts/ec2/deploy.sh
+++ b/samples/applications/single-cartridge/scripts/ec2/deploy.sh
@@ -1,17 +1,10 @@
 #!/bin/bash
 
 iaas="ec2"
-script_path=""
-if [ "$(uname)" == "Darwin" ]; then
-    script_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
-    script_path="$( cd -P "$( dirname "$SOURCE" )" && pwd )/`dirname $0`"
-else
-   echo "Unknown operating system"
-   exit
-fi
-common_folder="${script_path}/../common"
 
-pushd ${common_folder}
-bash deploy.sh ${iaas}
-popd
\ No newline at end of file
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/deploy.sh ${iaas}

http://git-wip-us.apache.org/repos/asf/stratos/blob/0236c249/samples/applications/single-cartridge/scripts/kubernetes/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-cartridge/scripts/kubernetes/deploy.sh b/samples/applications/single-cartridge/scripts/kubernetes/deploy.sh
index bc40868..0dd70e5 100755
--- a/samples/applications/single-cartridge/scripts/kubernetes/deploy.sh
+++ b/samples/applications/single-cartridge/scripts/kubernetes/deploy.sh
@@ -3,21 +3,14 @@
 host_ip="localhost"
 host_port=9443
 iaas="kubernetes"
-script_path=""
-if [ "$(uname)" == "Darwin" ]; then
-    script_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
-    script_path="$( cd -P "$( dirname "$SOURCE" )" && pwd )/`dirname $0`"
-else
-   echo "Unknown operating system"
-   exit
-fi
-common_folder="${script_path}/../common"
-iaas_artifacts_path="${script_path}/../../artifacts/${iaas}"
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+
+common_folder=`cd "${script_path}/../common"; pwd`
+iaas_artifacts_path=`cd "${script_path}/../../artifacts/${iaas}"; pwd`
 
 echo "Adding kubernetes cluster..."
 curl -X POST -H "Content-Type: application/json" -d "@${iaas_artifacts_path}/kubernetes-cluster.json" -k -u admin:admin https://${host_ip}:${host_port}/api/kubernetesClusters
 
-pushd ${common_folder}
-bash deploy.sh ${iaas}
-popd
\ No newline at end of file
+bash ${common_folder}/deploy.sh ${iaas}

http://git-wip-us.apache.org/repos/asf/stratos/blob/0236c249/samples/applications/single-cartridge/scripts/mock/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-cartridge/scripts/mock/deploy.sh b/samples/applications/single-cartridge/scripts/mock/deploy.sh
index b238692..283d92a 100755
--- a/samples/applications/single-cartridge/scripts/mock/deploy.sh
+++ b/samples/applications/single-cartridge/scripts/mock/deploy.sh
@@ -1,15 +1,10 @@
 #!/bin/sh
 
 iaas="mock"
-script_path=""
-if [ "$(uname)" == "Darwin" ]; then
-    script_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
-    script_path="$( cd -P "$( dirname "$SOURCE" )" && pwd )/`dirname $0`"
-else
-   echo "Unknown operating system"
-   exit
-fi
-common_folder="${script_path}/../common"
+
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+
+common_folder=`cd "${script_path}/../common"; pwd`
 
 bash ${common_folder}/deploy.sh ${iaas}

http://git-wip-us.apache.org/repos/asf/stratos/blob/0236c249/samples/applications/single-cartridge/scripts/openstack/deploy.sh
----------------------------------------------------------------------
diff --git a/samples/applications/single-cartridge/scripts/openstack/deploy.sh b/samples/applications/single-cartridge/scripts/openstack/deploy.sh
index ec3e536..5ac18ee 100755
--- a/samples/applications/single-cartridge/scripts/openstack/deploy.sh
+++ b/samples/applications/single-cartridge/scripts/openstack/deploy.sh
@@ -1,17 +1,10 @@
 #!/bin/bash
 
 iaas="openstack"
-script_path=""
-if [ "$(uname)" == "Darwin" ]; then
-    script_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
-    script_path="$( cd -P "$( dirname "$SOURCE" )" && pwd )/`dirname $0`"
-else
-   echo "Unknown operating system"
-   exit
-fi
-common_folder="${script_path}/../common"
 
-pushd ${common_folder}
-bash deploy.sh ${iaas}
-popd
\ No newline at end of file
+prgdir=`dirname "$0"`
+script_path=`cd "$prgdir"; pwd`
+
+common_folder=`cd "${script_path}/../common"; pwd`
+
+bash ${common_folder}/deploy.sh ${iaas}