Skip to content

Instantly share code, notes, and snippets.

@sparse91
Created May 7, 2021 10:52
Show Gist options
  • Save sparse91/24e0bb7fb2ce164d4781b4ef51ac70ac to your computer and use it in GitHub Desktop.
Save sparse91/24e0bb7fb2ce164d4781b4ef51ac70ac to your computer and use it in GitHub Desktop.
Gitlab Community Edition (CE) quota limit per project
#!/bin/bash -eu
###
### /opt/gitlab/embedded/service/gitlab-shell/hooks/pre-receive.d/quota.sh
### limit: 100MB
###
REPO_SIZE="$(du -s . | cut -f1)"
if (( "$REPO_SIZE" > 102400 ))
then
echo "Error: 100 MB quota per repo exceeded! Your size is $(( $REPO_SIZE / 1024 )) MB."
exit 1
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment