Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2751 from transcom/cg_diagnostic
Create a diagnostic target for the project.
- Loading branch information
Showing
5 changed files
with
64 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#! /usr/bin/env bash | ||
|
||
# | ||
# Script to check the available disk space Docker has used | ||
# | ||
|
||
set -eu -o pipefail | ||
|
||
# Location of the reserved docker disk space | ||
DOCKER_RAW=~/Library/Containers/com.docker.docker/Data/vms/0/Docker.raw | ||
|
||
# Listing the actual used size by docker requires du | ||
SIZE_ACTUAL=$(/usr/bin/du "${DOCKER_RAW}" | cut -f1) | ||
|
||
# Listing the logical size reserved by docker requires stat | ||
SIZE_RESERVED=$(/usr/bin/stat -f%z "${DOCKER_RAW}") | ||
|
||
# Compare the size to get percentage used | ||
# Give an integer number so the if-statement will work in bash | ||
PERCENT_USED=$(python -c "print('{0:.0f}'.format((${SIZE_ACTUAL} / (1024 * 1024 * 2)) / (${SIZE_RESERVED} / (1024 * 1024 * 1024)) * 100))") | ||
echo "Docker is using $PERCENT_USED% of its available disk space!" | ||
if [[ ${PERCENT_USED} -gt 90 ]]; then | ||
echo "Consider running 'docker system prune --volumes' to free up space" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#! /usr/bin/env bash | ||
|
||
set -eu -o pipefail | ||
|
||
VERSION="v10.16" | ||
|
||
NODE_VERSION=$(node --version) | ||
if [[ $NODE_VERSION = *$VERSION* ]]; then | ||
echo "Node $NODE_VERSION installed" | ||
else | ||
echo "Node $VERSION is required to run this project! Found $NODE_VERSION" | ||
echo "Run 'brew install node@10 && brew link --force node@10' to install" | ||
exit 1 | ||
fi | ||
|