jambonz-mini: build webapp in packer rather than when deployed

This commit is contained in:
Dave Horton committed 2022-03-17 20:55:43 -04:00
1 parent a8b885a313
commit 9f43c222ae
2 files changed
+7 -5

No files matched your search

+6 -4
View File
@@ -61,7 +61,7 @@ Parameters:
Mappings:
AWSRegion2AMI:
us-east-1:
Ami: ami-070ec74766e893dd8
Ami: ami-0e2b5e5e6a5fa46ce
Resources:
VPC:
Type: 'AWS::EC2::VPC'
@@ -142,9 +142,11 @@ Resources:
echo "REACT_APP_ENABLE_SUBSPACE=1" >>
/home/admin/apps/jambonz-webapp/.env
- >
cd /home/admin/apps/jambonz-webapp && npm run build
- |
# update ecosystem.config.js with private ip
REACT_APP_API_BASE_URL=http://${PUBLIC_IPV4}/api/v1
- >
TAG="<script>window.JAMBONZ = { APP_API_BASE_URL: '${REACT_APP_API_BASE_URL}'};</script>"
- >
sed -i -e "\@</head>@i\ $TAG" /home/admin/apps/jambonz-webapp/build/index.html
- >
sudo -u admin bash -c "pm2 restart
/home/admin/apps/ecosystem.config.js"
+1 -1
View File
@@ -13,7 +13,7 @@ cd /home/admin/apps/fsw-clear-old-calls && npm ci --unsafe-perm && sudo npm inst
echo "building jambonz-api-server.."
cd /home/admin/apps/jambonz-api-server && npm ci --unsafe-perm
echo "building jambonz-webapp.."
cd /home/admin/apps/jambonz-webapp && npm ci --unsafe-perm
cd /home/admin/apps/jambonz-webapp && npm ci --unsafe-perm && npm run build
echo "building sbc-options-handler.."
cd /home/admin/apps/sbc-options-handler && npm ci --unsafe-perm
echo "building sbc-inbound.."