Skip to content

Commit

Permalink
Perform first build if doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
simonrw committed Nov 29, 2024
1 parent 154b0be commit 6e5d5da
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bin/deploy_cdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ set -euo pipefail
AWS_CMD=${AWS_CMD:-aws}
CDK_CMD=${CDK_CMD:-cdk}

# stub build the frontend code since the CDK stack needs this code to
# synthesise the FrontendStack, but we don't yet know the backend URL to inject
# into the static HTML
if [ ! -d frontend/build ]; then
(cd frontend
echo "REACT_APP_API_ENDPOINT=https://example.com" > .env.local
npx react-scripts build
)
fi

# deploy bulk of the application
(cd cdk
npm run cdk -- deploy --require-approval never QuizAppStack
Expand Down

0 comments on commit 6e5d5da

Please sign in to comment.