diff --git a/build.sh b/build.sh index 7fa3546..1938d82 100644 --- a/build.sh +++ b/build.sh @@ -10,18 +10,23 @@ npm run build cd ../../ mv tools/janken/tool build cd main-web/server +npm run build +cd ../../ +cd build/ +export catherine_db_endpoint=$(aws --region=ap-northeast-1 ssm get-parameter --name "db-endpoint" --with-decryption --output text --query Parameter.Value) export catherine_db_user=$(aws --region=ap-northeast-1 ssm get-parameter --name "db-username" --with-decryption --output text --query Parameter.Value) export catherine_db_pass=$(aws --region=ap-northeast-1 ssm get-parameter --name "db-password" --with-decryption --output text --query Parameter.Value) cat > .env < = {}; const players: Record = {}; +console.log(process.env.DB_ENDPOINT); const connection = mysql.createPool({ connectionLimit: 10, - host: 'catherine-fc.csmrqtei38qi.ap-northeast-1.rds.amazonaws.com', + port: (process.env.DB_PORT ? parseInt(process.env.DB_PORT, 10) : 3306), + host: process.env.DB_ENDPOINT, user: process.env.DB_USER, password: process.env.DB_PASS, database: 'catherine_league'