You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bigtop.apache.org by ev...@apache.org on 2016/04/23 10:16:53 UTC

[2/2] bigtop git commit: BIGTOP-2312. Add environment check

BIGTOP-2312. Add environment check


Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo
Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/52d5e65e
Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/52d5e65e
Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/52d5e65e

Branch: refs/heads/BIGTOP-2253
Commit: 52d5e65e95626fb45238d8938cbe8627b6c398a2
Parents: f79f127
Author: Evans Ye <ev...@apache.org>
Authored: Sat Apr 23 08:14:39 2016 +0000
Committer: Evans Ye <ev...@apache.org>
Committed: Sat Apr 23 08:14:39 2016 +0000

----------------------------------------------------------------------
 provisioner/docker/docker-hadoop.sh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/bigtop/blob/52d5e65e/provisioner/docker/docker-hadoop.sh
----------------------------------------------------------------------
diff --git a/provisioner/docker/docker-hadoop.sh b/provisioner/docker/docker-hadoop.sh
index 2323456..93c8c9c 100755
--- a/provisioner/docker/docker-hadoop.sh
+++ b/provisioner/docker/docker-hadoop.sh
@@ -26,6 +26,7 @@ usage() {
     echo "       -e, --exec INSTANCE_NO|INSTANCE_NAME      Execute command on a specific instance. Instance can be specified by name or number."
     echo "                                                 For example: $PROG --exec 1 bash"
     echo "                                                              $PROG --exec docker_bigtop_1 bash"
+    echo "       -E, --env-check                           Check whether required tools has been installed"
     echo "       -p, --provision                           Deploy configuration changes"
     echo "       -s, --smoke-tests                         Run Bigtop smoke tests"
     echo "       -h, --help"
@@ -155,6 +156,16 @@ execute() {
     fi
 }
 
+env-check() {
+    echo "Environment check..."
+    echo "Check docker:"
+    docker -v || exit 1
+    echo "Check docker-compose:"
+    docker-compose -v || exit 1
+    echo "Check ruby:"
+    ruby -v || exit 1
+}
+
 PROG=`basename $0`
 
 if [ $# -eq 0 ]; then
@@ -169,6 +180,7 @@ while [ $# -gt 0 ]; do
           echo "Create requires a number" 1>&2
           usage
         fi
+        env-check
         create $2
         shift 2;;
     -C|--conf)
@@ -189,6 +201,9 @@ while [ $# -gt 0 ]; do
         shift
         execute $@
         shift $#;;
+    -E|--env-check)
+        env-check
+        shift;;
     -p|--provision)
         provision
         shift;;