Skip to content

Commit 09b8c1c

Browse files
authored
Merge pull request #1884 from taomaree/custom_hooks_dir
Add support for GITLAB_SHELL_CUSTOM_HOOKS_DIR
2 parents 6b619f4 + 3a8f5a3 commit 09b8c1c

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,7 @@ Below is the complete list of available options that can be used to customize yo
812812
| `GITLAB_PROJECTS_SNIPPETS` | Set if *snippets* feature should be enabled by default for new projects. Defaults to `false`. |
813813
| `GITLAB_PROJECTS_BUILDS` | Set if *builds* feature should be enabled by default for new projects. Defaults to `true`. |
814814
| `GITLAB_PROJECTS_CONTAINER_REGISTRY` | Set if *container_registry* feature should be enabled by default for new projects. Defaults to `true`. |
815+
| `GITLAB_SHELL_CUSTOM_HOOKS_DIR` | Global custom hooks directory. Defaults to `/home/git/gitlab-shell/hooks`. |
815816
| `GITLAB_WEBHOOK_TIMEOUT` | Sets the timeout for webhooks. Defaults to `10` seconds. |
816817
| `GITLAB_NOTIFY_ON_BROKEN_BUILDS` | Enable or disable broken build notification emails. Defaults to `true` |
817818
| `GITLAB_NOTIFY_PUSHER` | Add pusher to recipients list of broken build notification emails. Defaults to `false` |

assets/runtime/env-defaults

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,9 @@ GITALY_TOKEN=${GITALY_TOKEN:-}
505505
GITALY_SOCKET_PATH=${GITLAB_INSTALL_DIR}/tmp/sockets/private/gitaly.socket
506506
GITALY_ADDRESS=${GITALY_ADDRESS:-unix:$GITALY_SOCKET_PATH}
507507

508+
## GitLab Shell
509+
GITLAB_SHELL_CUSTOM_HOOKS_DIR=${GITLAB_SHELL_CUSTOM_HOOKS_DIR:-"$GITLAB_SHELL_INSTALL_DIR/hooks"}
510+
508511
## MONITORING
509512
GITLAB_MONITORING_UNICORN_SAMPLER_INTERVAL=${GITLAB_MONITORING_UNICORN_SAMPLER_INTERVAL:-10}
510513
GITLAB_MONITORING_IP_WHITELIST=${GITLAB_MONITORING_IP_WHITELIST:-"0.0.0.0/8"}

assets/runtime/functions

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1721,6 +1721,13 @@ configure_gitlab_shell() {
17211721
REDIS_HOST \
17221722
REDIS_PORT \
17231723
REDIS_DB_NUMBER
1724+
1725+
# update custom_hooks_dir if set $GITLAB_SHELL_CUSTOM_HOOKS_DIR
1726+
if [[ -n ${GITLAB_SHELL_CUSTOM_HOOKS_DIR} ]]; then
1727+
exec_as_git sed -i \
1728+
"s|custom_hooks_dir:.*|custom_hooks_dir: $GITLAB_SHELL_CUSTOM_HOOKS_DIR|g" \
1729+
${GITLAB_SHELL_CONFIG}
1730+
fi
17241731
}
17251732

17261733

0 commit comments

Comments
 (0)