Skip to content
Snippets Groups Projects
Commit d64090b8 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

No gitolite in project any more

parent 8e0b58d7
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -7,7 +7,7 @@ namespace :gitlab do
 
 
namespaces = Namespace.pluck(:path)
git_base_path = Gitlab.config.gitolite.repos_path
git_base_path = Gitlab.config.gitlab_shell.repos_path
all_dirs = Dir.glob(git_base_path + '/*')
 
puts git_base_path.yellow
Loading
Loading
@@ -48,7 +48,7 @@ namespace :gitlab do
warn_user_is_not_gitlab
remove_flag = ENV['REMOVE']
 
git_base_path = Gitlab.config.gitolite.repos_path
git_base_path = Gitlab.config.gitlab_shell.repos_path
all_dirs = Dir.glob(git_base_path + '/*')
 
global_projects = Project.where(namespace_id: nil).pluck(:path)
Loading
Loading
@@ -68,13 +68,6 @@ namespace :gitlab do
global_projects.include?(path)
end
 
# skip gitolite admin
all_dirs.reject! do |dir|
repo_name = File.basename dir
repo_name == 'gitolite-admin.git'
end
all_dirs.each do |dir_path|
if remove_flag
if FileUtils.rm_rf dir_path
Loading
Loading
Loading
Loading
@@ -6,11 +6,6 @@ namespace :gitlab do
migrate_user_namespaces
migrate_groups
migrate_projects
puts "Rebuild Gitolite ... "
gitolite = Gitlab::Gitolite.new
gitolite.update_repositories(Project.where('namespace_id IS NOT NULL'))
puts "... #{"done".green}"
end
 
def migrate_user_namespaces
Loading
Loading
@@ -80,7 +75,7 @@ namespace :gitlab do
end
 
def migrate_projects
git_path = Gitlab.config.gitolite.repos_path
git_path = Gitlab.config.gitlab_shell.repos_path
puts "\nMove projects in groups into respective directories ... ".blue
Project.where('namespace_id IS NOT NULL').find_each(batch_size: 500) do |project|
next unless project.group
Loading
Loading
Loading
Loading
@@ -12,7 +12,7 @@ namespace :gitlab do
desc "GITLAB | Import bare repositories from git_host -> base_path into GitLab project instance"
task :repos => :environment do
 
git_base_path = Gitlab.config.gitolite.repos_path
git_base_path = Gitlab.config.gitlab_shell.repos_path
repos_to_import = Dir.glob(git_base_path + '/*')
 
namespaces = Namespace.pluck(:path)
Loading
Loading
@@ -26,7 +26,6 @@ namespace :gitlab do
# skip if not git repo
next unless repo_name =~ /.git$/
 
# skip gitolite admin
next if repo_name == 'gitolite-admin.git'
 
path = repo_name.sub(/\.git$/, '')
Loading
Loading
Loading
Loading
@@ -54,16 +54,16 @@ namespace :gitlab do
 
 
# check Gitolite version
gitolite_version_file = "#{Gitlab.config.gitolite.repos_path}/../gitlab-shell/VERSION"
if File.readable?(gitolite_version_file)
gitolite_version = File.read(gitolite_version_file)
gitlab_shell_version_file = "#{Gitlab.config.gitlab_shell.repos_path}/../gitlab-shell/VERSION"
if File.readable?(gitlab_shell_version_file)
gitlab_shell_version = File.read(gitlab_shell_version_file)
end
 
puts ""
puts "GitLab Shell".yellow
puts "Version:\t#{gitolite_version || "unknown".red}"
puts "Repositories:\t#{Gitlab.config.gitolite.repos_path}"
puts "Hooks:\t\t#{Gitlab.config.gitolite.hooks_path}"
puts "Version:\t#{gitlab_shell_version || "unknown".red}"
puts "Repositories:\t#{Gitlab.config.gitlab_shell.repos_path}"
puts "Hooks:\t\t#{Gitlab.config.gitlab_shell.hooks_path}"
puts "Git:\t\t#{Gitlab.config.git.bin_path}"
 
end
Loading
Loading
Loading
Loading
@@ -8,7 +8,7 @@ namespace :gitlab do
desc "GITLAB | Build missing projects"
task build_missing_projects: :environment do
Project.find_each(batch_size: 1000) do |project|
path_to_repo = File.join(Gitlab.config.gitolite.repos_path, "#{project.path_with_namespace}.git")
path_to_repo = File.join(Gitlab.config.gitlab_shell.repos_path, "#{project.path_with_namespace}.git")
if File.exists?(path_to_repo)
print '-'
else
Loading
Loading
Loading
Loading
@@ -6,7 +6,7 @@ namespace :sidekiq do
 
desc "GITLAB | Start sidekiq"
task :start do
run "nohup bundle exec sidekiq -q post_receive,mailer,system_hook,project_web_hook,gitolite,common,default -e #{Rails.env} -P #{pidfile} >> #{Rails.root.join("log", "sidekiq.log")} 2>&1 &"
run "nohup bundle exec sidekiq -q post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default -e #{Rails.env} -P #{pidfile} >> #{Rails.root.join("log", "sidekiq.log")} 2>&1 &"
end
 
def pidfile
Loading
Loading
Loading
Loading
@@ -35,7 +35,7 @@ RSpec.configure do |config|
config.before do
# Use tmp dir for FS manipulations
temp_repos_path = Rails.root.join('tmp', 'test-git-base-path')
Gitlab.config.gitolite.stub(repos_path: temp_repos_path)
Gitlab.config.gitlab_shell.stub(repos_path: temp_repos_path)
FileUtils.rm_rf temp_repos_path
FileUtils.mkdir_p temp_repos_path
end
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