4 Star 16 Fork 12

saicov/evcharger_awsiot_sam_gitee

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
go.sh 1.79 KB
一键复制 编辑 原始数据 按行查看 历史
eelaix 提交于 2024-01-17 10:03 . ok
#!/bin/sh
echo
echo
echo ......................................
echo
echo
# plz change region in file template.yaml and samconfig.toml
# plz change account-id in file template.yaml
# plz change "kr-xniot-sam" to others if needed, (2 in this file, 1 in samconfig.toml)
# plz change Queue setting in template.yaml (arn:aws:sqs:ap-northeast-2:264381684832:espQUEUE)
# aws s3 mb s3://hk-xniot-sam
aws s3 mb s3://kr-xniot-sam
# aws s3 mb s3://eu-xniot-sam
aws iot create-thing-type \
--thing-type-name "XNEVBK" \
--thing-type-properties "thingTypeDescription=Created by ShenZhen Xiaoniu Company (www.mosf.cn),searchableAttributes=chargerid,connected,onltime"
qexists=`aws sqs list-queues --output text|grep espQUEUE`
if [ ${#qexists} -eq 0 ]; then
aws sqs create-queue --queue-name espQUEUE --attributes VisibilityTimeout=30
fi
cd dependencies/nodejs
rm -rf node_modules
rm -rf package-lock.json
npm install --save
cd ../..
# 注意修改config.mjs中的OTAS3BUCKET='afr-ota-eu'(2023.09) 需要打开版本控制,不能使用eu-xniot-sam
sam package --template-file template.yaml --s3-bucket kr-xniot-sam --output-template-file espapp.yaml
# sam package --template-file template.yaml --s3-bucket hk-xniot-sam --output-template-file espapp.yaml
sam deploy --template-file ./espapp.yaml --stack-name espapp --capabilities CAPABILITY_IAM
rm espapp.yaml
apiurl=`aws apigatewayv2 get-apis|grep ApiEndpoint|awk -F'\"' '{print $4}'`
sed -i "" "s#export const BASE = '.*';#export const BASE = '$apiurl';#" ../evcharger_awsIoT_vue_gitee/src/config.js
echo ===========================================================
echo $apiurl
echo "This URL used in ../evcharger_awsIoT_vue_gitee/src/config.js"
echo "Goto ../evcharger_awsIoT_vue_gitee/ run ./go.sh for Web apps"
echo ===========================================================
echo
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/saicov/evcharger_awsiot_sam_gitee.git
git@gitee.com:saicov/evcharger_awsiot_sam_gitee.git
saicov
evcharger_awsiot_sam_gitee
evcharger_awsiot_sam_gitee
master

搜索帮助