Skip to content

Commit

Permalink
Add logs to help debug startup script.
Browse files Browse the repository at this point in the history
  • Loading branch information
markspec committed Sep 27, 2023
1 parent f8f1e4d commit b84abba
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -207,18 +207,20 @@ ExecStart=/etc/systemd/system/shutdown.sh
[Install]
WantedBy=multi-user.target
EOF1
chmod +x /etc/systemd/system/shutdown.sh
systemctl daemon-reload
systemctl enable shutdown.service
gcloud compute instances add-labels ${VM_ID} --zone=${machine_zone} --labels=gh_ready=0 && \\
RUNNER_ALLOW_RUNASROOT=1 ./config.sh --url https://github.com/${GITHUB_REPOSITORY} --token ${RUNNER_TOKEN} --labels ${VM_ID} --unattended ${ephemeral_flag} --disableupdate && \\
./svc.sh install && \\
./svc.sh start && \\
gcloud compute instances add-labels ${VM_ID} --zone=${machine_zone} --labels=gh_ready=1
# 3 days represents the max workflow runtime. This will shutdown the instance if everything else fails.
nohup sh -c \"sleep 3d && gcloud --quiet compute instances delete ${VM_ID} --zone=${machine_zone}\" > /dev/null &
"
gcloud compute instances add-labels ${VM_ID} --zone=${machine_zone} --labels=gh_ready=0 && \\
RUNNER_ALLOW_RUNASROOT=1 ./config.sh --url https://github.com/${GITHUB_REPOSITORY} --token ${RUNNER_TOKEN} --labels ${VM_ID} --unattended ${ephemeral_flag} --disableupdate 2> /var/log/ss_error.txt 1> /var/log/output.txt && \\
./svc.sh install 2>> /var/log/ss_error2.txt 1>> /var/log/output2.txt && \\
./svc.sh start 2>> /var/log/ss_error3.txt 1>> /var/log/output3.txt && \\
gcloud compute instances add-labels ${VM_ID} --zone=${machine_zone} --labels=gh_ready=1
# 3 days represents the max workflow runtime. This will shutdown the instance if everything else fails.
nohup sh -c \"sleep 3d && gcloud --quiet compute instances delete ${VM_ID} --zone=${machine_zone}\" > /dev/null &
"

if $actions_preinstalled ; then
echo "✅ Startup script won't install GitHub Actions (pre-installed)"
Expand Down

0 comments on commit b84abba

Please sign in to comment.