add comments
parent
cdcfd8561d
commit
e6dc7243f3
|
@ -882,6 +882,7 @@ jobs:
|
|||
fi
|
||||
sudo touch /var/run/job.in.progress
|
||||
rm -rf cleanup.sh install_cleanup.sh
|
||||
# after this PR is merged, update URLs to get the scripts from github master
|
||||
wget https://storage.googleapis.com/minikube-ci-utils/cleanup.sh
|
||||
wget https://storage.googleapis.com/minikube-ci-utils/install_cleanup.sh
|
||||
chmod +x cleanup.sh install_cleanup.sh
|
||||
|
|
|
@ -879,6 +879,7 @@ jobs:
|
|||
fi
|
||||
sudo touch /var/run/job.in.progress
|
||||
rm -rf cleanup.sh install_cleanup.sh
|
||||
# after this PR is merged, update URLs to get the scripts from github master
|
||||
wget https://storage.googleapis.com/minikube-ci-utils/cleanup.sh
|
||||
wget https://storage.googleapis.com/minikube-ci-utils/install_cleanup.sh
|
||||
chmod +x cleanup.sh install_cleanup.sh
|
||||
|
|
|
@ -19,6 +19,8 @@ REBOOT_MARK=/var/run/reboot.in.progress
|
|||
|
||||
timeout=900 # 15 minutes
|
||||
|
||||
# $PROGRESS_MARK file is touched when a new GitHub Actions job is started
|
||||
# check that no job was started in the last 15 minutes
|
||||
function check_running_job() {
|
||||
if [[ -f "$PROGRESS_MARK" ]]; then
|
||||
started=$(date -r "$PROGRESS_MARK" +%s)
|
||||
|
@ -35,6 +37,7 @@ function check_running_job() {
|
|||
|
||||
check_running_job
|
||||
sudo touch "$REBOOT_MARK"
|
||||
# avoid race if a job was started between two lines above and recheck
|
||||
check_running_job
|
||||
|
||||
echo "cleanup docker..."
|
||||
|
|
|
@ -19,10 +19,12 @@ if [[ ! -f cleanup.sh ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# update cron to run the cleanup script every hour
|
||||
if [ ! -f /etc/cron.hourly/cleanup.sh ]; then
|
||||
sudo install cleanup.sh /etc/cron.hourly/cleanup || echo "FAILED TO INSTALL CLEANUP"
|
||||
sudo install cleanup.sh /etc/cron.hourly/cleanup.sh || echo "FAILED TO INSTALL CLEANUP"
|
||||
fi
|
||||
|
||||
# install a cron rule to remove /var/run/reboot.in.progress file immediately after reboot
|
||||
if (crontab -l 2>/dev/null | grep '@reboot rm -rf /var/run/reboot.in.progress'); then
|
||||
echo "reboot cron rule already installed"
|
||||
exit 0
|
||||
|
|
Loading…
Reference in New Issue