diff options
author | Stan Hu <stanhu@gmail.com> | 2018-01-09 01:26:26 -0800 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-01-09 01:29:03 -0800 |
commit | f400c4f56008813f54f756bd19d007adfe8ef827 (patch) | |
tree | 4185c692599ec8e27a46c460f96784e344fdf869 /lib | |
parent | f8f314890758983e9d167529cb3a332a01262d5c (diff) | |
download | gitlab-shell-sh-add-hooks-command.tar.gz |
Add a create-hooks command for import Rake tasksh-add-hooks-command
With the introduction of hashed storage, the import Rake task needs to be able
to copy a repo and then initialize the hooks as a separate step from creating
the project directory.
Relates to gitlab-org/gitlab-ce#41739 and
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/16280
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab_projects.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/gitlab_projects.rb b/lib/gitlab_projects.rb index 6700735..7da97ae 100644 --- a/lib/gitlab_projects.rb +++ b/lib/gitlab_projects.rb @@ -57,6 +57,9 @@ class GitlabProjects create_tag when 'add-project'; add_project + when 'create-hooks'; + # To avoid confusion with self.class.create_hooks + create_project_hooks when 'list-projects'; puts list_projects when 'rm-project'; @@ -182,6 +185,10 @@ class GitlabProjects system(*cmd) && self.class.create_hooks(full_path) end + def create_project_hooks + self.class.create_hooks(full_path) + end + def list_projects $logger.info 'Listing projects' Dir.chdir(repos_path) do |