Skip to content

Commit

Permalink
consider ENV for init.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
walf443 committed Aug 31, 2019
1 parent ad844f7 commit 58eaf98
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions webapp/sql/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ set -xe
set -o pipefail

CURRENT_DIR=$(cd $(dirname $0);pwd)
export MYSQL_PWD="isucari"
export MYSQL_HOST=${MYSQL_HOST:-127.0.0.1}
export MYSQL_PORT=${MYSQL_PORT:-3306}
export MYSQL_USER=${MYSQL_USER:-isucari}
export MYSQL_DBNAME=${MYSQL_DBNAME:-isucari}
export MYSQL_PASS=${MYSQL_PASS:-isucari}
export LANG="C.UTF-8"
cd $CURRENT_DIR

cat 01_schema.sql 02_categories.sql initial.sql | mysql --defaults-file=/dev/null -u isucari isucari
cat 01_schema.sql 02_categories.sql initial.sql | mysql --defaults-file=/dev/null -h $MYSQL_HOST -P $MYSQL_PORT -u $MYSQL_USER -p$MYSQL_PASS $MYSQL_DBNAME

0 comments on commit 58eaf98

Please sign in to comment.