blob: 934207579b1ddeba4f0c329862372271963c2852 (
plain)
- #!/bin/sh
- # This gitolite3 hook exports content for web publishing.
- # The following gitolite3 environment variables affect its use:
- # WEB_BRANCH tree-ish (hook silently skipped if unset)
- # WEB_BASEDIR path writable by gitolite3 (default: /var/www/gitolite3)
- set -eu
- [ -n "$GL_OPTION_WEB_BRANCH" ] || exit 0
- # which git branch to check out
- WEB_BASEDIR=${GL_OPTION_WEB_BASEDIR:-/var/www/gitolite3}
- GIT_WORK_TREE="$WEB_BASEDIR/$GL_REPO"
- export GIT_WORK_TREE
- pwd
- echo "Checking out content to $GIT_WORK_TREE ..."
- git checkout -f "$GL_OPTION_WEB_BRANCH"
- chmod -R u=rw,go=r,a+X "$GIT_WORK_TREE"
- echo "Checkout completed succesfully!"
|