#!/bin/bash

[[ "${VM}" = "" ]] && VM=easy-jenkins

set -e

docker-machine ls

if docker-machine ls | grep ${VM} >/dev/null; then
    echo "WARNING: Docker machine ${VM} exists, skipping docker-machine create"
else
    docker-machine create --driver virtualbox \
      --virtualbox-cpu-count "2" \
      --virtualbox-disk-size "50000" \
      --virtualbox-memory "3048" \
      ${VM}
fi

docker-machine env ${VM}

eval $(docker-machine env ${VM})
docker-compose up -d

# EOF

#!/bin/bash

MACHINE=easy-jenkins

set -e

docker-machine ls

if docker-machine ls | grep ${MACHINE} >/dev/null; then
    echo "WARNING: Docker machine ${MACHINE} exists, skipping docker-machine create"
else
    docker-machine create --driver virtualbox \
      --virtualbox-cpu-count "2" \
      --virtualbox-disk-size "50000" \
      --virtualbox-memory "3048" \
      ${MACHINE}
fi

docker-machine env ${MACHINE}

eval $(docker-machine env ${MACHINE})
docker-compose up -d

# EOF

--- 
+++ 
@@ -1,24 +1,24 @@
 #!/bin/bash
 
-MACHINE=easy-jenkins
+[[ "${VM}" = "" ]] && VM=easy-jenkins
 
 set -e
 
 docker-machine ls
 
-if docker-machine ls | grep ${MACHINE} >/dev/null; then
-    echo "WARNING: Docker machine ${MACHINE} exists, skipping docker-machine create"
+if docker-machine ls | grep ${VM} >/dev/null; then
+    echo "WARNING: Docker machine ${VM} exists, skipping docker-machine create"
 else
     docker-machine create --driver virtualbox \
       --virtualbox-cpu-count "2" \
       --virtualbox-disk-size "50000" \
       --virtualbox-memory "3048" \
-      ${MACHINE}
+      ${VM}
 fi
 
-docker-machine env ${MACHINE}
+docker-machine env ${VM}
 
-eval $(docker-machine env ${MACHINE})
+eval $(docker-machine env ${VM})
 docker-compose up -d
 
 # EOF
Configure VM name via enviroment variable

Signed-off-by: Gianpaolo Macario <f8885408b8c3d931b330bae3c3a28a3af912c463@gmail.com>
