Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

Commit 1e95486

Browse files
authored
Revert "Feat/ci fix (#1101)" (#1102)
This reverts commit 93bc24e.
1 parent 93bc24e commit 1e95486

File tree

2 files changed

+25
-33
lines changed

2 files changed

+25
-33
lines changed
Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,49 @@
11
#!/bin/bash
22

33
profile="cirunner"
4-
runner_vpc_id="vpc-0323d32f82edcdec7"
4+
runner_vpc_id1="vpc-8bdf97ec"
5+
runner_vpc_id2="vpc-1176d875"
56
region_opt="--region us-west-2"
67

78
# Get runner status
8-
runner1=$(aws ec2 describe-instances --profile $profile --filters Name=tag:Name,Values=[super1] Name=network-interface.vpc-id,Values=[$runner_vpc_id] --query "Reservations[*].Instances[*][InstanceId]" ${region_opt} --output text | xargs)
9-
runner2=$(aws ec2 describe-instances --profile $profile --filters Name=tag:Name,Values=[super2] Name=network-interface.vpc-id,Values=[$runner_vpc_id] --query "Reservations[*].Instances[*][InstanceId]" ${region_opt} --output text | xargs)
9+
runner1=$(aws ec2 describe-instances --profile $profile --filters Name=tag:Name,Values=[jenkins] Name=network-interface.vpc-id,Values=[$runner_vpc_id1] --query "Reservations[*].Instances[*][InstanceId]" ${region_opt} --output text | xargs)
10+
runner2=$(aws ec2 describe-instances --profile $profile --filters Name=tag:Name,Values=[jenkins] Name=network-interface.vpc-id,Values=[$runner_vpc_id2] --query "Reservations[*].Instances[*][InstanceId]" --output text | xargs)
1011

11-
# start runner1
12-
while true; do
13-
runner_status=$(aws ec2 describe-instances --profile $profile --instance-ids $runner1 --query "Reservations[*].Instances[*].State.[Name]" ${region_opt} --output text)
14-
echo 'runner1 - '$runner_status
15-
if [[ $runner_status = "stopped" ]]; then
16-
aws ec2 start-instances --profile $profile --instance-ids $runner1 ${region_opt}
17-
break
18-
elif [[ $runner_status = "running" ]]; then
19-
echo 'waiting for runner1 restore'
20-
sleep 30
12+
{
13+
while true; do
2114
runner_status=$(aws ec2 describe-instances --profile $profile --instance-ids $runner1 --query "Reservations[*].Instances[*].State.[Name]" ${region_opt} --output text)
22-
if [[ $runner_status = "running" ]]; then
15+
echo 'runner1 - '$runner_status
16+
if [[ $runner_status = "stopped" ]]; then
17+
aws ec2 start-instances --profile $profile --instance-ids $runner1 ${region_opt}
2318
break
19+
elif [[ $runner_status = "running" ]]; then
20+
echo 'waiting for runner1 restore'
21+
sleep 30
22+
runner_status=$(aws ec2 describe-instances --profile $profile --instance-ids $runner1 --query "Reservations[*].Instances[*].State.[Name]" ${region_opt} --output text)
23+
if [[ $runner_status = "running" ]]; then
24+
break
25+
fi
26+
else
27+
sleep 30
2428
fi
25-
else
26-
sleep 30
27-
fi
28-
done
29-
30-
# start runner2
29+
done
30+
}&
3131
while true; do
32-
runner_status=$(aws ec2 describe-instances --profile $profile --instance-ids $runner2 --query "Reservations[*].Instances[*].State.[Name]" ${region_opt} --output text)
32+
runner_status=$(aws ec2 describe-instances --profile $profile --instance-ids $runner2 --query "Reservations[*].Instances[*].State.[Name]" --output text)
3333
echo 'runner2 - '$runner_status
3434
if [[ $runner_status = "stopped" ]]; then
35-
aws ec2 start-instances --profile $profile --instance-ids $runner2 ${region_opt}
35+
aws ec2 start-instances --profile $profile --instance-ids $runner2
3636
break
3737
elif [[ $runner_status = "running" ]]; then
3838
echo 'waiting for runner2 restore'
3939
sleep 30
40-
runner_status=$(aws ec2 describe-instances --profile $profile --instance-ids $runner2 --query "Reservations[*].Instances[*].State.[Name]" ${region_opt} --output text)
40+
runner_status=$(aws ec2 describe-instances --profile $profile --instance-ids $runner2 --query "Reservations[*].Instances[*].State.[Name]" --output text)
4141
if [[ $runner_status = "running" ]]; then
4242
break
4343
fi
4444
else
4545
sleep 30
4646
fi
4747
done
48+
49+
exit 0

.github/workflows/select-runner.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,3 @@ jobs:
3838
outputs:
3939
matrix1: ${{ toJSON( fromJSON(inputs.matrices)[1] ) }}
4040
matrix2: ${{ toJSON( fromJSON(inputs.matrices)[2] ) }}
41-
42-
wakeup:
43-
name: Wake up self-hosted runner
44-
if: ${{ inputs.enabled }}
45-
needs: [select]
46-
runs-on: ${{ inputs.bastion-host }}
47-
concurrency: ${{ needs.select.outputs.matrix1 }}
48-
steps:
49-
- uses: actions/checkout@v4
50-
- run: .github/ciChecksScripts/wakeUpRunner.sh

0 commit comments

Comments
 (0)