summaryrefslogtreecommitdiff
path: root/lib/tasks
diff options
context:
space:
mode:
authorDrew Blessing <drew@gitlab.com>2016-08-02 22:46:43 -0600
committerDrew Blessing <drew@gitlab.com>2016-11-01 14:52:59 -0500
commitaf5322e90b47e830e7713482854ddf6450a0d8c1 (patch)
treeaa15e96de4e970a83323da613b4b50eef367e703 /lib/tasks
parentf73f09b1e079e2c1e1793878437f00731af5e177 (diff)
downloadgitlab-ce-af5322e90b47e830e7713482854ddf6450a0d8c1.tar.gz
Add Rake task to create/repair GitLab Shell hooks symlinks
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/gitlab/shell.rake15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/tasks/gitlab/shell.rake b/lib/tasks/gitlab/shell.rake
index 210899882b4..58761a129d4 100644
--- a/lib/tasks/gitlab/shell.rake
+++ b/lib/tasks/gitlab/shell.rake
@@ -63,11 +63,11 @@ namespace :gitlab do
# Launch installation process
system(*%W(bin/install) + repository_storage_paths_args)
-
- # (Re)create hooks
- system(*%W(bin/create-hooks) + repository_storage_paths_args)
end
+ # (Re)create hooks
+ Rake::Task['gitlab:shell:create_hooks'].invoke
+
# Required for debian packaging with PKGR: Setup .ssh/environment with
# the current PATH, so that the correct ruby version gets loaded
# Requires to set "PermitUserEnvironment yes" in sshd config (should not
@@ -102,6 +102,15 @@ namespace :gitlab do
end
end
end
+
+ desc 'Create or repair repository hooks symlink'
+ task create_hooks: :environment do
+ warn_user_is_not_gitlab
+
+ puts 'Creating/Repairing hooks symlinks for all repositories'
+ system(*%W(#{Gitlab.config.gitlab_shell.path}/bin/create-hooks) + repository_storage_paths_args)
+ puts 'done'.color(:green)
+ end
end
def setup