add deploy script

This commit is contained in:
2025-06-21 10:10:53 +09:00
parent 82b6a7a718
commit 89edcce799
8 changed files with 47 additions and 8 deletions

18
backend/deploy.sh Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
set -e
tmpdir=$(mktemp -d)
trap 'rm -rf "$tmpdir"' EXIT
cd $(dirname $0)/dist
zip -r "$tmpdir/lambda.zip" .
cd $tmpdir
aws s3 cp lambda.zip "s3://$IMBUSY_BE_BUCKET"
cd $(dirname $0)
aws lambda update-function-code \
--function-name $IMBUSY_BE_LAMBDA \
--s3-bucket $IMBUSY_BE_BUCKET \
--s3-key lambda.zip

View File

@@ -6,7 +6,8 @@
"scripts": {
"build": "esbuild src/index.ts --bundle --platform=node --target=node18 --outfile=dist/index.js",
"clean": "rm -rf dist",
"watch": "npm run build -- --watch"
"watch": "npm run build -- --watch",
"deploy": "./deploy.sh"
},
"keywords": [],
"author": "",