summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-09 15:21:19 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-02-09 15:21:19 +0200
commit2f019b2b4ca7ab646427b81ebaf3ff96cda211f4 (patch)
treec70c2370a9c09543eee5ac6cb5583da3216c303a
parentff76e05271d50536c2c94b98d2949ad13355b78c (diff)
downloadgitlab-ce-2f019b2b4ca7ab646427b81ebaf3ff96cda211f4.tar.gz
cleanup rake tasks since no gitolite required
-rw-r--r--lib/tasks/gitlab/cleanup.rake33
-rw-r--r--lib/tasks/gitlab/enable_automerge.rake17
-rw-r--r--lib/tasks/gitlab/gitolite_rebuild.rake27
-rw-r--r--lib/tasks/gitlab/setup.rake1
4 files changed, 9 insertions, 69 deletions
diff --git a/lib/tasks/gitlab/cleanup.rake b/lib/tasks/gitlab/cleanup.rake
index 2a0ffe0f4bd..a81ef22ffb8 100644
--- a/lib/tasks/gitlab/cleanup.rake
+++ b/lib/tasks/gitlab/cleanup.rake
@@ -1,38 +1,5 @@
namespace :gitlab do
namespace :cleanup do
- desc "GITLAB | Cleanup | Clean gitolite config"
- task :config => :environment do
- warn_user_is_not_gitlab
-
- real_repos = Project.all.map(&:path_with_namespace)
- real_repos << "gitolite-admin"
- real_repos << "@all"
-
- remove_flag = ENV['REMOVE']
-
- puts "Looking for repositories to remove... "
- Gitlab::GitoliteConfig.new.apply do |config|
- all_repos = []
- garbage_repos = []
-
- all_repos = config.conf.repos.keys
- garbage_repos = all_repos - real_repos
-
- garbage_repos.each do |repo_name|
- if remove_flag
- config.conf.rm_repo(repo_name)
- print "to remove...".red
- end
-
- puts repo_name.red
- end
- end
-
- unless remove_flag
- puts "To cleanup repositories run this command with REMOVE=true".yellow
- end
- end
-
desc "GITLAB | Cleanup | Clean namespaces"
task :dirs => :environment do
warn_user_is_not_gitlab
diff --git a/lib/tasks/gitlab/enable_automerge.rake b/lib/tasks/gitlab/enable_automerge.rake
index a89c6eaa5c4..6822e5cf1ad 100644
--- a/lib/tasks/gitlab/enable_automerge.rake
+++ b/lib/tasks/gitlab/enable_automerge.rake
@@ -1,12 +1,18 @@
namespace :gitlab do
- desc "GITLAB | Enable auto merge"
- task :enable_automerge => :environment do
+ namespace :satellites do
+ desc "GITLAB | Create satellite repos"
+ task create: :environment do
+ create_satellites
+ end
+ end
+
+ def create_satellites
warn_user_is_not_gitlab
print "Creating satellites for ..."
unless Project.count > 0
puts "skipping, because you have no projects".magenta
- next
+ return
end
puts ""
@@ -33,9 +39,4 @@ namespace :gitlab do
end
end
end
-
- namespace :satellites do
- desc "GITLAB | Create satellite repos"
- task create: 'gitlab:enable_automerge'
- end
end
diff --git a/lib/tasks/gitlab/gitolite_rebuild.rake b/lib/tasks/gitlab/gitolite_rebuild.rake
deleted file mode 100644
index af2a2127ee2..00000000000
--- a/lib/tasks/gitlab/gitolite_rebuild.rake
+++ /dev/null
@@ -1,27 +0,0 @@
-namespace :gitlab do
- namespace :gitolite do
- desc "GITLAB | Rebuild each project in Gitolite config"
- task :update_repos => :environment do
- warn_user_is_not_gitlab
-
- puts "Rebuilding projects ... "
- Project.find_each(:batch_size => 100) do |project|
- puts "#{project.name_with_namespace.yellow} ... "
- project.update_repository
- puts "... #{"done".green}"
- end
- end
-
- desc "GITLAB | Rebuild each user key in Gitolite config"
- task :update_keys => :environment do
- warn_user_is_not_gitlab
-
- puts "Rebuilding keys ... "
- Key.find_each(:batch_size => 100) do |key|
- puts "#{key.identifier.yellow} ... "
- Gitlab::Gitolite.new.set_key(key.identifier, key.key, key.projects)
- puts "... #{"done".green}"
- end
- end
- end
-end
diff --git a/lib/tasks/gitlab/setup.rake b/lib/tasks/gitlab/setup.rake
index 5699e5d6188..bc0742564d0 100644
--- a/lib/tasks/gitlab/setup.rake
+++ b/lib/tasks/gitlab/setup.rake
@@ -14,7 +14,6 @@ namespace :gitlab do
Rake::Task["db:setup"].invoke
Rake::Task["db:seed_fu"].invoke
- Rake::Task["gitlab:enable_automerge"].invoke
rescue Gitlab::TaskAbortedByUserError
puts "Quitting...".red
exit 1