We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a4e13c commit e20e713Copy full SHA for e20e713
bin/deploy_cdk.sh
@@ -0,0 +1,26 @@
1
+#!/usr/bin/env bash
2
+
3
+set -euo pipefail
4
5
+AWS_CMD=${AWS_CMD:-aws}
6
+CDK_CMD=${CDK_CMD:-cdk}
7
8
+# deploy bulk of the application
9
+(cd cdk
10
+npm run cdk -- deploy --require-approval never QuizAppStack
11
+)
12
13
+# get the backend API url
14
+API_URL=$($AWS_CMD cloudformation describe-stacks --stack-name QuizAppStack --query Stacks[0].Outputs[0].OutputValue --output text)
15
+echo "Backend API URL: $API_URL"
16
17
+# build the frontend code
18
+(cd frontend
19
+echo "REACT_APP_API_ENDPOINT=$API_URL" > .env.local
20
+npx react-scripts build
21
22
23
+# deploy the frontend stack
24
25
+npm run ${CDK_CMD} -- deploy --require-approval never FrontendStack
26
0 commit comments