mirror of
https://github.com/sameersbn/docker-gitlab.git
synced 2026-01-25 14:08:09 +00:00
init: specify database port in mysql and postgresql commands, Fixes #197
This commit is contained in:
parent
d7d06528d8
commit
3f5e306354
@ -612,11 +612,11 @@ appStart () {
|
||||
# for the database server to come online.
|
||||
case "${DB_TYPE}" in
|
||||
mysql)
|
||||
prog="mysqladmin -h ${DB_HOST} -u ${DB_USER} ${DB_PASS:+-p$DB_PASS} status"
|
||||
prog="mysqladmin -h ${DB_HOST} -P ${DB_PORT} -u ${DB_USER} ${DB_PASS:+-p$DB_PASS} status"
|
||||
;;
|
||||
postgres)
|
||||
prog=$(find /usr/lib/postgresql/ -name pg_isready)
|
||||
prog="${prog} -h ${DB_HOST} -U ${DB_USER} -d ${DB_NAME} -t 1"
|
||||
prog="${prog} -h ${DB_HOST} -p ${DB_PORT} -U ${DB_USER} -d ${DB_NAME} -t 1"
|
||||
;;
|
||||
esac
|
||||
timeout=60
|
||||
@ -635,11 +635,11 @@ appStart () {
|
||||
case "${DB_TYPE}" in
|
||||
mysql)
|
||||
QUERY="SELECT count(*) FROM information_schema.tables WHERE table_schema = '${DB_NAME}';"
|
||||
COUNT=$(mysql -h ${DB_HOST} -u ${DB_USER} ${DB_PASS:+-p$DB_PASS} -ss -e "${QUERY}")
|
||||
COUNT=$(mysql -h ${DB_HOST} -P ${DB_PORT} -u ${DB_USER} ${DB_PASS:+-p$DB_PASS} -ss -e "${QUERY}")
|
||||
;;
|
||||
postgres)
|
||||
QUERY="SELECT count(*) FROM information_schema.tables WHERE table_schema = 'public';"
|
||||
COUNT=$(PGPASSWORD="${DB_PASS}" psql -h ${DB_HOST} -U ${DB_USER} -d ${DB_NAME} -Atw -c "${QUERY}" 2>/dev/null)
|
||||
COUNT=$(PGPASSWORD="${DB_PASS}" psql -h ${DB_HOST} -p ${DB_PORT} -U ${DB_USER} -d ${DB_NAME} -Atw -c "${QUERY}" 2>/dev/null)
|
||||
;;
|
||||
esac
|
||||
if [ -z "${COUNT}" -o ${COUNT} -eq 0 ]; then
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user