Created updated scripts to deploy/destroy manually
All checks were successful
AWS Deploy on Push / build (push) Successful in 1m30s

This commit is contained in:
2025-05-15 11:38:53 -05:00
parent c53e65d713
commit 91406f2439
3 changed files with 31 additions and 3 deletions

View File

@@ -1,4 +1,23 @@
#!/bin/bash
npm install -g aws-cdk
python3 -m pip install -r requirements.txt
cdk deploy
# Deploy infrastructure
cdk deploy
# Update application on running instances
INSTANCE_IDS=$(aws ec2 describe-instances \
--filters "Name=tag:Name,Values=IptvUpdater/IptvUpdaterInstance" \
"Name=instance-state-name,Values=running" \
--query "Reservations[].Instances[].InstanceId" \
--output text)
for INSTANCE_ID in $INSTANCE_IDS; do
echo "Updating application on instance: $INSTANCE_ID"
aws ssm send-command \
--instance-ids "$INSTANCE_ID" \
--document-name "AWS-RunShellScript" \
--parameters '{"commands":["cd /home/ec2-user/iptv-updater-aws && git pull && pip3 install -r requirements.txt && sudo systemctl restart iptv-updater"]}' \
--no-cli-pager \
--no-paginate
done
echo "Deployment and instance update complete"