This repository has been archived by the owner on Jun 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added postgres container to encapsulate db initialization. enhanced r…
…un.sh to do proper checking of container status to avoid docker stop and docker rm error messages
- Loading branch information
Li Lin
committed
Jan 29, 2015
1 parent
af5c9af
commit 3cb7005
Showing
7 changed files
with
108 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM postgres:9.3 | ||
MAINTAINER Li Lin <[email protected]> | ||
|
||
RUN mkdir -p /docker-entrypoint-initdb.d | ||
ADD atl-dbinit.sh /docker-entrypoint-initdb.d | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
DB_USER=$postgres | ||
|
||
create_db_if_not_exist() { | ||
|
||
( psql -l -U $DB_USER | grep $1 ) || \ | ||
echo " CREATE DATABASE $1 WITH ENCODING='UTF8' TEMPLATE=template0; " | psql -U $DB_USER | ||
} | ||
|
||
create_db_if_not_exist jira | ||
create_db_if_not_exist stash | ||
create_db_if_not_exist fisheye | ||
create_db_if_not_exist bamboo | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
TAG="sloppycoder/atl-postgres" | ||
docker build --rm --tag ${TAG}:latest . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,11 @@ cd atl-bamboo | |
./build.sh | ||
cd .. | ||
|
||
cd atl-postgres | ||
./build.sh | ||
cd .. | ||
|
||
|
||
cd atl-web | ||
./build.sh | ||
cd .. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters