-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·43 lines (33 loc) · 879 Bytes
/
deploy.sh
File metadata and controls
executable file
·43 lines (33 loc) · 879 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
set -e
# Deployment script for Football API Gateway Target
# Usage: ./deploy.sh <env-file>
# Example: ./deploy.sh .env.xiaozhi2.local
if [ -z "$1" ]; then
echo "Usage: $0 <env-file>"
echo "Example: $0 .env.xiaozhi2.local"
exit 1
fi
ENV_FILE=$1
if [ ! -f "$ENV_FILE" ]; then
echo "Error: Environment file '$ENV_FILE' not found"
exit 1
fi
echo "Loading environment from: $ENV_FILE"
set -a
source "$ENV_FILE"
set +a
echo "Getting AWS account ID..."
export CDK_DEFAULT_ACCOUNT=$(aws sts get-caller-identity --query Account --output text)
echo "Account ID: $CDK_DEFAULT_ACCOUNT"
echo "Gateway: $GATEWAY_IDENTIFIER"
echo "Credential Provider: $CREDENTIAL_PROVIDER_NAME"
echo "Region: $AWS_REGION"
echo ""
echo "Building project..."
npm run build
echo ""
echo "Deploying to AWS..."
cdk deploy --require-approval never
echo ""
echo "Deployment complete!"