Skip to content

Commit 02f4cb5

Browse files
authored
Update deploy.sh
1 parent e086979 commit 02f4cb5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

generate-runners/deploy.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ if [[ -n "${OWNER}" && -n "${REPO}" ]]; then
6363
PREFIX=repos
6464
fi
6565

66+
# make swap file if not exists. useful for adhoc cloud runners
67+
if [[ -z $(swapon --show=SIZE --raw --noheadings | sed 's/[^0-9]//g') ]]; then
68+
sudo fallocate -l $(free -h | awk 'NR==2{print(int(substr($2,1,length($2)-1)/2+.5))}')G /swapfile
69+
sudo chmod 600 /swapfile
70+
sudo mkswap /swapfile
71+
sudo swapon /swapfile
72+
fi
73+
6674
# update OS and install dependencies
6775
sudo apt-get -q update
6876
[[ -z $(command -v xmllint) ]] && sudo apt-get -yy install libxml2-utils

0 commit comments

Comments
 (0)