Added installation of aws client to workflow - Fix 3
All checks were successful
AWS Deploy on Push / build (push) Successful in 1m9s
All checks were successful
AWS Deploy on Push / build (push) Successful in 1m9s
This commit is contained in:
@@ -49,10 +49,22 @@ jobs:
|
|||||||
|
|
||||||
- name: Update application on instance
|
- name: Update application on instance
|
||||||
run: |
|
run: |
|
||||||
INSTANCE_ID=$(aws ec2 describe-instances --filters "Name=tag:Name,Values=IptvUpdater/IptvUpdaterInstance" --query "Reservations[*].Instances[*].InstanceId" --output text)
|
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
|
||||||
aws ssm send-command \
|
aws ssm send-command \
|
||||||
--instance-ids "$INSTANCE_ID" \
|
--instance-ids "$INSTANCE_ID" \
|
||||||
--document-name "AWS-RunShellScript" \
|
--document-name "AWS-RunShellScript" \
|
||||||
--parameters 'commands=["cd /home/ec2-user/iptv-updater-aws && git pull && pip3 install -r requirements.txt && systemctl restart iptv-updater"]'
|
--parameters 'commands=[
|
||||||
|
"cd /home/ec2-user/iptv-updater-aws",
|
||||||
|
"git pull",
|
||||||
|
"pip3 install -r requirements.txt",
|
||||||
|
"sudo systemctl restart iptv-updater"
|
||||||
|
]'
|
||||||
|
done
|
||||||
|
|
||||||
- run: echo "This job's status is ${{ job.status }}."
|
- run: echo "This job's status is ${{ job.status }}."
|
||||||
Reference in New Issue
Block a user