Skip to content
This repository has been archived by the owner on Jun 3, 2023. It is now read-only.

Commit

Permalink
added backup data container to run.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
sloppycoder committed Jan 28, 2015
1 parent ef77b2c commit af5c9af
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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


30 changes: 21 additions & 9 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ echo "
Usage:
run.sh all # startup everything
run.sh # startup everything
run.sh all #
run.sh <app> # stop and remove <app> container, create a new one in background
# then restart web server
Expand All @@ -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 <dir> # backup all data inside data container into <dir>/atldata.tar.gz
run.sh clean # remoev all untagged images
"
Expand Down Expand Up @@ -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

;;
Expand All @@ -142,14 +147,21 @@ case "$ACTION" in
init_db
;;

dbserver)
dbshell)
docker exec -it postgres /bin/bash
;;

data)
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 "^<none>" | awk ' {print $3} ')
;;
Expand Down

0 comments on commit af5c9af

Please sign in to comment.