modified to auto upload to s3
This commit is contained in:
11
build.sh
11
build.sh
@@ -10,18 +10,23 @@ npm run build
|
|||||||
cd ../../
|
cd ../../
|
||||||
mv tools/janken/tool build
|
mv tools/janken/tool build
|
||||||
cd main-web/server
|
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_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)
|
export catherine_db_pass=$(aws --region=ap-northeast-1 ssm get-parameter --name "db-password" --with-decryption --output text --query Parameter.Value)
|
||||||
cat > .env <<EOL
|
cat > .env <<EOL
|
||||||
|
DB_ENDPOINT=${catherine_db_endpoint}
|
||||||
DB_USER=${catherine_db_user}
|
DB_USER=${catherine_db_user}
|
||||||
DB_PASS=${catherine_db_pass}
|
DB_PASS=${catherine_db_pass}
|
||||||
EOL
|
EOL
|
||||||
npm run build
|
cd ../
|
||||||
cd ../../
|
|
||||||
cp main-web/server/.env build/
|
cp main-web/server/.env build/
|
||||||
cp main-web/server/package.json build/
|
cp main-web/server/package.json build/
|
||||||
cp main-web/server/tsconfig.json build/
|
cp main-web/server/tsconfig.json build/
|
||||||
cp main-web/server/tslint.json build/
|
cp main-web/server/tslint.json build/
|
||||||
mv main-web/server/build build/server
|
mv main-web/server/build build/server
|
||||||
tar czf build.tar.gz build/
|
tar czf build.tar.gz build/
|
||||||
rm -rf build/
|
rm -rf build/
|
||||||
|
aws s3 cp build.tar.gz s3://catherine-fc-infra/
|
||||||
2
main-web/server/.gitignore
vendored
2
main-web/server/.gitignore
vendored
@@ -1,4 +1,4 @@
|
|||||||
admin/
|
admin/
|
||||||
client/
|
client/
|
||||||
build/
|
build/
|
||||||
.env
|
.env*
|
||||||
@@ -16,9 +16,11 @@ const io: socketIo.Server = socketIo(httpServer);
|
|||||||
|
|
||||||
const tournaments: Record<string, number> = {};
|
const tournaments: Record<string, number> = {};
|
||||||
const players: Record<string, number> = {};
|
const players: Record<string, number> = {};
|
||||||
|
console.log(process.env.DB_ENDPOINT);
|
||||||
const connection = mysql.createPool({
|
const connection = mysql.createPool({
|
||||||
connectionLimit: 10,
|
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,
|
user: process.env.DB_USER,
|
||||||
password: process.env.DB_PASS,
|
password: process.env.DB_PASS,
|
||||||
database: 'catherine_league'
|
database: 'catherine_league'
|
||||||
|
|||||||
Reference in New Issue
Block a user