community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgard...@apache.org
Subject svn commit: r1694756 - in /comdev/tools/scripts: config.sh config.tmpl configHyper-v.sh migrateDev.sh push.sh
Date Sat, 08 Aug 2015 03:12:36 GMT
Author: rgardler
Date: Sat Aug  8 03:12:36 2015
New Revision: 1694756

URL: http://svn.apache.org/r1694756
Log:
add a 'local' target to the push script for deploying on the Comdev (or other) local host
+ make scripts executable

Modified:
    comdev/tools/scripts/config.sh
    comdev/tools/scripts/config.tmpl
    comdev/tools/scripts/configHyper-v.sh
    comdev/tools/scripts/migrateDev.sh
    comdev/tools/scripts/push.sh

Modified: comdev/tools/scripts/config.sh
URL: http://svn.apache.org/viewvc/comdev/tools/scripts/config.sh?rev=1694756&r1=1694755&r2=1694756&view=diff
==============================================================================
--- comdev/tools/scripts/config.sh (original)
+++ comdev/tools/scripts/config.sh Sat Aug  8 03:12:36 2015
@@ -1,13 +1,13 @@
-# Docker Host names
-DEV_MACHINE_NAME=dev
-
-STAGE_MACHINE_NAME=dockerDemo3
-STAGE_PORT=8000
-
-PROD_MACHINE_NAME=tutorialProd
-
-# Variables needed to workaround bug in folder sharing
-# on Windows, see configureDevHyper-v.sh
-USER_NAME=ross@gardler.org
-CLIENT_IP=192.168.1.25
-CLIENT_PATH_TO_PROJECT=Users/Ross/projects/comdev/tools
+# Docker Host names
+DEV_MACHINE_NAME=dev
+
+STAGE_MACHINE_NAME=dockerDemo3
+STAGE_PORT=8000
+
+PROD_MACHINE_NAME=tutorialProd
+
+# Variables needed to workaround bug in folder sharing
+# on Windows, see configureDevHyper-v.sh
+USER_NAME=ross@gardler.org
+CLIENT_IP=192.168.1.25
+CLIENT_PATH_TO_PROJECT=Users/Ross/projects/comdev/tools

Modified: comdev/tools/scripts/config.tmpl
URL: http://svn.apache.org/viewvc/comdev/tools/scripts/config.tmpl?rev=1694756&r1=1694755&r2=1694756&view=diff
==============================================================================
--- comdev/tools/scripts/config.tmpl (original)
+++ comdev/tools/scripts/config.tmpl Sat Aug  8 03:12:36 2015
@@ -1,13 +1,13 @@
-# Docker Host names
-DEV_MACHINE_NAME=tutorialDev
-
-STAGE_MACHINE_NAME=tutorialStage
-STAGE_PORT=8888
-
-PROD_MACHINE_NAME=tutorialProd
-
-# Variables needed to workaround bug in folder sharing
-# on Windows, see configureDevHyper-v.sh
-USER_NAME=< WINDOWS CLIENT USERNAME >
-CLIENT_IP=<WINDOWS CLIENT IP >
-CLIENT_PATH_TO_PROJECT=< WINDOWS CLIENT PATH TO PROJECT FILES, EXCLUDING DRIVE LETTER,
E.G. Users/username/path/to/folder >
+# Docker Host names
+DEV_MACHINE_NAME=tutorialDev
+
+STAGE_MACHINE_NAME=tutorialStage
+STAGE_PORT=8888
+
+PROD_MACHINE_NAME=tutorialProd
+
+# Variables needed to workaround bug in folder sharing
+# on Windows, see configureDevHyper-v.sh
+USER_NAME=< WINDOWS CLIENT USERNAME >
+CLIENT_IP=<WINDOWS CLIENT IP >
+CLIENT_PATH_TO_PROJECT=< WINDOWS CLIENT PATH TO PROJECT FILES, EXCLUDING DRIVE LETTER,
E.G. Users/username/path/to/folder >

Modified: comdev/tools/scripts/configHyper-v.sh
URL: http://svn.apache.org/viewvc/comdev/tools/scripts/configHyper-v.sh?rev=1694756&r1=1694755&r2=1694756&view=diff
==============================================================================
--- comdev/tools/scripts/configHyper-v.sh (original)
+++ comdev/tools/scripts/configHyper-v.sh Sat Aug  8 03:12:36 2015
@@ -1,17 +1,17 @@
-# There is currently (5/31/2015) a bug in docker-machine/boot2docker that
-# means shared folders do not work as expected. To work around this
-# bug run the following script (after editing the last line) each time you 
-# provsiion a hyper-v docker-machine.
-
-source scripts/config.sh
-
-read -s -p "What is the password for the user account '$USER_NAME'?" USER_PASSWORD
-
-echo
-echo "Configuring $DEV_MACHINE_NAME to share meetups webapp at /home/docker/comdev/meetups"
-
-docker-machine ssh $DEV_MACHINE_NAME wget http://distro.ibiblio.org/tinycorelinux/5.x/x86/tcz/cifs-utils.tcz
-docker-machine ssh $DEV_MACHINE_NAME -- tce-load -i cifs-utils.tcz
-echo "Mounting //$CLIENT_IP/$CLIENT_PATH_TO_PROJECT as /home/docker/comdev/meetups"
-docker-machine ssh $DEV_MACHINE_NAME -- "mkdir -p /home/docker/comdev/meetups"
-docker-machine ssh $DEV_MACHINE_NAME -- "sudo mount -t cifs //$CLIENT_IP/$CLIENT_PATH_TO_PROJECT
/home/docker/comdev/meetups -o user=$USER_NAME,password=$USER_PASSWORD"
+# There is currently (5/31/2015) a bug in docker-machine/boot2docker that
+# means shared folders do not work as expected. To work around this
+# bug run the following script (after editing the last line) each time you 
+# provsiion a hyper-v docker-machine.
+
+source scripts/config.sh
+
+read -s -p "What is the password for the user account '$USER_NAME'?" USER_PASSWORD
+
+echo
+echo "Configuring $DEV_MACHINE_NAME to share meetups webapp at /home/docker/comdev/meetups"
+
+docker-machine ssh $DEV_MACHINE_NAME wget http://distro.ibiblio.org/tinycorelinux/5.x/x86/tcz/cifs-utils.tcz
+docker-machine ssh $DEV_MACHINE_NAME -- tce-load -i cifs-utils.tcz
+echo "Mounting //$CLIENT_IP/$CLIENT_PATH_TO_PROJECT as /home/docker/comdev/meetups"
+docker-machine ssh $DEV_MACHINE_NAME -- "mkdir -p /home/docker/comdev/meetups"
+docker-machine ssh $DEV_MACHINE_NAME -- "sudo mount -t cifs //$CLIENT_IP/$CLIENT_PATH_TO_PROJECT
/home/docker/comdev/meetups -o user=$USER_NAME,password=$USER_PASSWORD"

Modified: comdev/tools/scripts/migrateDev.sh
URL: http://svn.apache.org/viewvc/comdev/tools/scripts/migrateDev.sh?rev=1694756&r1=1694755&r2=1694756&view=diff
==============================================================================
--- comdev/tools/scripts/migrateDev.sh (original)
+++ comdev/tools/scripts/migrateDev.sh Sat Aug  8 03:12:36 2015
@@ -1,15 +1,15 @@
-echo "##################################################################################################"
-echo "# Migrate the database"
-echo "##################################################################################################"
-
-source scripts/config.sh
-
-docker-machine env $DEV_MACHINE_NAME
-eval "$(docker-machine env $DEV_MACHINE_NAME)"
-
-docker exec meetups_app python manage.py makemigrations events_list
-docker exec meetups_app python manage.py migrate
-
-echo "##################################################################################################"
-echo "# Done"
-echo "##################################################################################################"
+echo "##################################################################################################"
+echo "# Migrate the database"
+echo "##################################################################################################"
+
+source scripts/config.sh
+
+docker-machine env $DEV_MACHINE_NAME
+eval "$(docker-machine env $DEV_MACHINE_NAME)"
+
+docker exec meetups_app python manage.py makemigrations events_list
+docker exec meetups_app python manage.py migrate
+
+echo "##################################################################################################"
+echo "# Done"
+echo "##################################################################################################"

Modified: comdev/tools/scripts/push.sh
URL: http://svn.apache.org/viewvc/comdev/tools/scripts/push.sh?rev=1694756&r1=1694755&r2=1694756&view=diff
==============================================================================
--- comdev/tools/scripts/push.sh (original)
+++ comdev/tools/scripts/push.sh Sat Aug  8 03:12:36 2015
@@ -1,91 +1,106 @@
-echo "##################################################################################################"
-echo "# Push a clean build of the containers to dev, stage"
-echo "# BEWARE: this will kill all data on the chosen machine, use with extreme caution"
-echo "##################################################################################################"
-
-source scripts/config.sh
-
-read -p "What kind of deployment do you want (enter 'dev' or 'stage') " type
-case $type in
-    "dev")
-	eval "$(docker-machine env $DEV_MACHINE_NAME)"
-	;;
-    "stage")
-	eval "$(docker-machine env $STAGE_MACHINE_NAME)"
-	;;
-    *)
-	echo "Unkown option, aborting"
-        exit 255
-	;;
-esac
-
-
-echo "DOCKER_HOST is set to $DOCKER_HOST"
-echo "DOCKER_MACHINE_NAME is set to $DOCKER_MACHINE_NAME"
-echo "Do you really want to start clean containers on this machine?"
-read -p "Remember, it will destroy all data.\nEnter 'Yes' to confirm: " CONFIRM
-
-if [ $CONFIRM != "Yes" ]; then
-  echo "Phew!!! That was close, aborting"
-  exit 1
-fi
-
-echo "##################################################################################################"
-echo "# Remove old dev containers that may still be running"
-echo "##################################################################################################"
-docker rm -f meetups_db
-docker rm -f meetups_app
-
-echo "##################################################################################################"
-echo "# Start the database container"
-echo "##################################################################################################"
-case $type in
-    "dev")
-	docker run -d -v //home/docker/project:/project -p 5432:5432 --name meetups_db postgres
-	;;
-    "stage")
-	docker run -d -p 5432:5432 --name meetups_db postgres
-	;;
-esac
-sleep 3 # a small delay to ensure the DB hads time to start before we try to conenct to it
-
-echo "##################################################################################################"
-echo "# Build the application container"
-echo "##################################################################################################"
-docker build -t meetups .
-
-echo "##################################################################################################"
-echo "# Configure the database"
-echo "##################################################################################################"
-case $type in
-    "dev")
-	docker run --rm -v //home/docker/comdev/meetups:/project --link meetups_db:db meetups python
manage.py makemigrations events_list
-	docker run --rm -v //home/docker/comdev/meetups:/project --link meetups_db:db meetups python
manage.py migrate
-	;;
-    "stage")
-	docker run --rm --link meetups_db:db meetups python manage.py makemigrations events_list
-	docker run --rm --link meetups_db:db meetups python manage.py migrate
-	;;
-esac
-
-echo "##################################################################################################"
-echo "# Setup a superuser (hit return to continue once created)"
-echo "##################################################################################################"
-docker run --rm -it --link meetups_db:db meetups python manage.py createsuperuser
-
-echo "##################################################################################################"
-echo "# Run the application"
-echo "##################################################################################################"
-case $type in
-    "dev")
-	docker run --rm -v //home/docker/comdev/meetups:/project --link meetups_db:db -p 80:8000
--name meetups_app meetups python manage.py runserver 0.0.0.0:8000
-	;;
-    "stage")
-	docker run -d --link meetups_db:db -p $STAGE_PORT:8000 --name meetups_app meetups python
manage.py runserver 0.0.0.0:8000
-	;;
-esac
-
-echo "##################################################################################################"
-echo "# Assuming no errors above your application is now running."
-echo "# You should first create one or more hashtags and then import some meetups"
-echo "##################################################################################################"
+echo "##################################################################################################"
+echo "# Push a clean build of the containers to 'dev', 'stage' or 'local'"
+echo "# 'dev' deploys with a mounted volume so that the source can be edited on the fly"
+echo "# 'stage' deploys with a copy of the current source to the staging server"
+echo "# 'local' deploys with a copy of the current source to the local host"
+echo "# BEWARE: this will kill all data on the chosen machine, use with extreme caution"
+echo "##################################################################################################"
+
+source ./scripts/config.sh
+
+read -p "What kind of deployment do you want (enter 'dev', 'stage', 'local') " type
+case $type in
+    "dev")
+	eval "$(docker-machine env $DEV_MACHINE_NAME)"
+	;;
+    "stage")
+	eval "$(docker-machine env $STAGE_MACHINE_NAME)"
+	;;
+    "local")
+	;;
+    *)
+	echo "Unkown option, aborting"
+        exit 255
+	;;
+esac
+
+
+echo "DOCKER_HOST is set to $DOCKER_HOST"
+echo "DOCKER_MACHINE_NAME is set to $DOCKER_MACHINE_NAME"
+echo "Do you really want to start clean containers on this machine?"
+read -p "Remember, it will destroy all data.\nEnter 'Yes' to confirm: " CONFIRM
+
+if [ $CONFIRM != "Yes" ]; then
+  echo "Phew!!! That was close, aborting"
+  exit 1
+fi
+
+echo "##################################################################################################"
+echo "# Remove old dev containers that may still be running"
+echo "##################################################################################################"
+docker rm -f meetups_db
+docker rm -f meetups_app
+
+echo "##################################################################################################"
+echo "# Start the database container"
+echo "##################################################################################################"
+case $type in
+    "dev")
+	docker run -d -v //home/docker/project:/project -p 5432:5432 --name meetups_db postgres
+	;;
+    "stage")
+	docker run -d -p 5432:5432 --name meetups_db postgres
+	;;
+    "local")
+	docker run -d -p 5432:5432 --name meetups_db postgres
+	;;
+esac
+sleep 3 # a small delay to ensure the DB hads time to start before we try to conenct to it
+
+echo "##################################################################################################"
+echo "# Build the application container"
+echo "##################################################################################################"
+docker build -t meetups .
+
+echo "##################################################################################################"
+echo "# Configure the database"
+echo "##################################################################################################"
+case $type in
+    "dev")
+	docker run --rm -v //home/docker/comdev/meetups:/project --link meetups_db:db meetups python
manage.py makemigrations events_list
+	docker run --rm -v //home/docker/comdev/meetups:/project --link meetups_db:db meetups python
manage.py migrate
+	;;
+    "stage")
+	docker run --rm --link meetups_db:db meetups python manage.py makemigrations events_list
+	docker run --rm --link meetups_db:db meetups python manage.py migrate
+	;;
+    "local")
+	docker run --rm --link meetups_db:db meetups python manage.py makemigrations events_list
+	docker run --rm --link meetups_db:db meetups python manage.py migrate
+	;;
+esac
+
+echo "##################################################################################################"
+echo "# Setup a superuser (hit return to continue once created)"
+echo "##################################################################################################"
+docker run --rm -it --link meetups_db:db meetups python manage.py createsuperuser
+
+echo "##################################################################################################"
+echo "# Run the application"
+echo "##################################################################################################"
+case $type in
+    "dev")
+	docker run --rm -v //home/docker/comdev/meetups:/project --link meetups_db:db -p 80:8000
--name meetups_app meetups python manage.py runserver 0.0.0.0:8000
+	;;
+    "stage")
+	docker run -d --link meetups_db:db -p $STAGE_PORT:8000 --name meetups_app meetups python
manage.py runserver 0.0.0.0:8000
+	;;
+    "local")
+	docker run -d --link meetups_db:db -p 80:8000 --name meetups_app meetups python manage.py
runserver 0.0.0.0:8000
+	;;
+esac
+
+echo "##################################################################################################"
+echo "# Assuming no errors above your application is now running."
+echo "# You should first create one or more hashtags and then import some meetups"
+echo "##################################################################################################"



Mime
View raw message