Skip to content

Commit

Permalink
🔧 Check for space when building image
Browse files Browse the repository at this point in the history
  • Loading branch information
olejnjak committed May 14, 2024
1 parent 5a6a6fa commit 8b7f464
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ackee-xcode.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,14 @@ build {
"echo 'export JAVA_HOME=\"/opt/homebrew/opt/openjdk@17\"' >> ~/.zprofile",
]
}

// check there is at least 15GB of free space and fail if not
provisioner "shell" {
inline = [
"source ~/.zprofile",
"df -h",
"export FREE_MB=$(df -m | awk '{print $4}' | head -n 2 | tail -n 1)",
"[[ $FREE_MB -gt 15000 ]] && echo OK || exit 1"
]
}
}

0 comments on commit 8b7f464

Please sign in to comment.