Added scripts to create and delete users. Moved all scripts to new scripts folder
All checks were successful
AWS Deploy on Push / build (push) Successful in 4m21s

This commit is contained in:
2025-05-16 14:19:14 -05:00
parent 0b69ffd67c
commit a5dfc1b493
4 changed files with 54 additions and 0 deletions

23
scripts/deploy.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/bash
# 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"