As we reevaluate how to best support and maintain Staging Ref in the future, we encourage development teams using this environment to highlight their use cases in the following issue: https://gitlab.com/gitlab-com/gl-infra/software-delivery/framework/software-delivery-framework-issue-tracker/-/issues/36.

Skip to content
Snippets Groups Projects
Commit f400c4f5 authored by Stan Hu's avatar Stan Hu
Browse files

Add a create-hooks command for import Rake task

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
parent f8f31489
No related branches found
No related tags found
No related merge requests found
v5.11.1
- Add a 'create-hooks' command to gitlab-projects
v5.11.0
- Introduce a more-complete implementation of bin/authorized_keys (!178)
Loading
Loading
Loading
Loading
@@ -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';
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -55,6 +55,21 @@ describe GitlabProjects do
it { File.readlink(hooks_dir).should == target_hooks_dir }
end
context 'with command-line arguments' do
before do
FileUtils.mkdir_p repo_path
argv('create-hooks', tmp_repos_path, 'hook-test.git')
gl_projects = GitlabProjects.new
gl_projects.exec
end
after do
FileUtils.rm_f(repo_path)
end
it { File.readlink(hooks_dir).should == target_hooks_dir }
end
end
describe :initialize do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment