modified to auto upload to s3

This commit is contained in:
2020-08-09 15:24:09 +09:00
parent 9992386624
commit 2fa6740aac
3 changed files with 12 additions and 5 deletions

View File

@@ -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 <<EOL
DB_ENDPOINT=${catherine_db_endpoint}
DB_USER=${catherine_db_user}
DB_PASS=${catherine_db_pass}
EOL
npm run build
cd ../../
cd ../
cp main-web/server/.env build/
cp main-web/server/package.json build/
cp main-web/server/tsconfig.json build/
cp main-web/server/tslint.json build/
mv main-web/server/build build/server
tar czf build.tar.gz build/
rm -rf build/
rm -rf build/
aws s3 cp build.tar.gz s3://catherine-fc-infra/