Skip to content

Commit

Permalink
docker-machine support.
Browse files Browse the repository at this point in the history
  • Loading branch information
unimock committed Oct 17, 2016
1 parent 4acda05 commit 25b50e4
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/backup/
/docker-compose.yml
/.do.cfg
/.do-machine.cfg
.directory
/service
/ispc
Expand Down
39 changes: 36 additions & 3 deletions do
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
#!/bin/bash

if [ ! -e ./.do.cfg ] ; then
echo "DO_CNAME=ispc" > ./.do.cfg
CFG=./.do.cfg
DMC=./.do-machine.cfg

if [ ! -e $CFG ] ; then
echo "DO_CNAME=ispc" > $CFG
fi

SERVICEVOL=./service
. ./.do.cfg
. $CFG

DCN=$DO_CNAME

if [ -f $DMC ] ; then
. $DMC
fi


if [ "$1" = "" ] ; then
echo "usage: `basename $0` <command>"
echo " setup <container-name> [<machine-name>]"
echo " build ............... build image"
echo " up ................. create <$DCN> from image"
echo " rm ................. remove <$DCN>"
Expand All @@ -35,6 +44,30 @@ if [ "$1" = "" ] ; then
exit 0
fi

if [ ! -d ./build ] ; then
mkdir -p ./build
fi


if [ "$1" = "setup" ] ; then
if [ "$2" = "" ] ; then
echo "settings:"
cat $CFG
if [ -e $DMC ] ; then
cat $DMC
fi
exit 0
else
sed -i -e "s/^DO_CNAME=.*/DO_CNAME=$2/" $CFG
fi
. $CFG
if [ "$3" != "" ] ; then
docker-machine env $3
docker-machine env $3 > $DMC
. $DMC
fi
fi

if [ "$1" = "ps" ] ; then
docker-compose ps
fi
Expand Down

0 comments on commit 25b50e4

Please sign in to comment.