Skip to content

Commit

Permalink
Update deploy.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
igorpecovnik authored Sep 25, 2024
1 parent e086979 commit 02f4cb5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions generate-runners/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ if [[ -n "${OWNER}" && -n "${REPO}" ]]; then
PREFIX=repos
fi

# make swap file if not exists. useful for adhoc cloud runners
if [[ -z $(swapon --show=SIZE --raw --noheadings | sed 's/[^0-9]//g') ]]; then
sudo fallocate -l $(free -h | awk 'NR==2{print(int(substr($2,1,length($2)-1)/2+.5))}')G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
fi

# update OS and install dependencies
sudo apt-get -q update
[[ -z $(command -v xmllint) ]] && sudo apt-get -yy install libxml2-utils
Expand Down

0 comments on commit 02f4cb5

Please sign in to comment.