add comments

pull/11447/head
Ilya Zuyev 2021-05-19 14:53:04 -07:00
parent cdcfd8561d
commit e6dc7243f3
4 changed files with 8 additions and 1 deletions

View File

@ -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

View File

@ -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

View File

@ -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..."

View File

@ -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