From af5c9af26a5fac269121250b3f18ebfa03b46d15 Mon Sep 17 00:00:00 2001 From: Li Lin Date: Wed, 28 Jan 2015 17:29:32 +0000 Subject: [PATCH] added backup data container to run.sh --- README.md | 6 +++++- run.sh | 30 +++++++++++++++++++++--------- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index a613694..3692af9 100644 --- a/README.md +++ b/README.md @@ -30,4 +30,8 @@ Then point your browser at the URL below to install license and configuation fo ### TO DO -1. test more installation scenarios. +1. add initdb to one line provision. +2. format this document properly +3. add docker status check so that docker stop/rm does not throw error messages + + diff --git a/run.sh b/run.sh index 5f82bef..8fd7cc4 100755 --- a/run.sh +++ b/run.sh @@ -6,7 +6,8 @@ echo " Usage: - run.sh all # startup everything + run.sh # startup everything + run.sh all # run.sh # stop and remove container, create a new one in background # then restart web server @@ -18,10 +19,14 @@ echo " run.sh db # start db server + run.sh dbshell # launch a shell into db server + run.sh initdb # drop and recreate database used by applications run.sh data # start an interactive container for examine the shared data volumes + run.sh backup # backup all data inside data container into /atldata.tar.gz + run.sh clean # remoev all untagged images " @@ -102,21 +107,21 @@ case "$ACTION" in echo echo starting all docker containers for Atlassian Jira, Stash, Fisheye and Bamboo echo all images will be downloaded from docker hub for the first time, this will take a while - echo hit ctrl-C in next 5 seconds to abort ... + echo hit ctrl-C to abort ... echo - sleep 6 + sleep 2 start_data start_db - sleep 3 + sleep 2 start_app jira - sleep 3 + sleep 2 start_app stash - sleep 3 + sleep 2 start_app fisheye - sleep 3 + sleep 2 start_app bamboo - sleep 3 + sleep 2 start_web ;; @@ -142,7 +147,7 @@ case "$ACTION" in init_db ;; - dbserver) + dbshell) docker exec -it postgres /bin/bash ;; @@ -150,6 +155,13 @@ case "$ACTION" in docker run -it --rm --volumes-from="atldata" centos:7 /bin/bash ;; + backup) + BACKUP_DIR=$(readlink -f $2) + docker run -it --rm --volumes-from atldata -v $BACKUP_DIR:/backup sloppycoder/java-base \ + tar czvf /backup/atldata.tar.gz \ + /opt/atlassian-home /var/lib/postgresql/data + ;; + clean) docker rmi $(docker images | grep "^" | awk ' {print $3} ') ;;