add deploy script
This commit is contained in:
18
backend/deploy.sh
Executable file
18
backend/deploy.sh
Executable 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
|
@@ -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": "",
|
||||
|
Reference in New Issue
Block a user