-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·57 lines (49 loc) · 1.57 KB
/
deploy.sh
File metadata and controls
executable file
·57 lines (49 loc) · 1.57 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
set -e
echo "========================================="
echo "Telegram Photo Wall - AWS Deployment"
echo "========================================="
# Check AWS credentials
echo "Checking AWS credentials..."
aws sts get-caller-identity > /dev/null 2>&1 || {
echo "ERROR: AWS credentials not configured. Run 'aws configure' first."
exit 1
}
ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
REGION=${AWS_DEFAULT_REGION:-us-east-1}
echo "Account: $ACCOUNT_ID"
echo "Region: $REGION"
# Install CDK dependencies
echo ""
echo "Installing CDK dependencies..."
npm install
# Build frontend
echo ""
echo "Building frontend..."
cd photo-wall
npm install
npm run build
cd ..
# Bootstrap CDK (if needed)
echo ""
echo "Bootstrapping CDK..."
npx cdk bootstrap aws://$ACCOUNT_ID/$REGION 2>/dev/null || true
# Deploy
echo ""
echo "Deploying stack..."
npx cdk deploy --require-approval broadening
echo ""
echo "========================================="
echo "Deployment complete!"
echo "========================================="
echo ""
echo "Next steps:"
echo "1. Get the webhook secret:"
echo " aws secretsmanager get-secret-value --secret-id telegram/webhook-secret --query SecretString --output text"
echo ""
echo "2. Set Telegram webhook for each group:"
echo " curl -X POST 'https://api.telegram.org/bot<BOT_TOKEN>/setWebhook' \\"
echo " -H 'Content-Type: application/json' \\"
echo " -d '{\"url\": \"<WEBHOOK_URL>\", \"secret_token\": \"<WEBHOOK_SECRET>\", \"allowed_updates\": [\"message\"]}'"
echo ""
echo "3. Add the bot to your Telegram group"