From 2fa6740aaca674383e8d69ae7df6d792a387a3c8 Mon Sep 17 00:00:00 2001 From: Hansoo Date: Sun, 9 Aug 2020 15:24:09 +0900 Subject: [PATCH] modified to auto upload to s3 --- build.sh | 11 ++++++++--- main-web/server/.gitignore | 2 +- main-web/server/src/index.ts | 4 +++- 3 files changed, 12 insertions(+), 5 deletions(-) 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'