repo
end
+
+ def admin_all_repo
+ ga_repo = ::Gitolite::GitoliteAdmin.new(File.join(@local_dir,'gitolite'))
+ conf = ga_repo.config
+ owner_name = ""
+
+ # Read gitolite-admin user
+ #
+ begin
+ repo = conf.get_repo("gitolite-admin")
+ owner_name = repo.permissions[0]["RW+"][""][0]
+ raise StandardError if owner_name.blank?
+ rescue => ex
+ puts "Cant determine gitolite-admin owner".red
+ raise StandardError
+ end
+
+ # @ALL repos premission for gitolite owner
+ repo_name = "@all"
+ repo = if conf.has_repo?(repo_name)
+ conf.get_repo(repo_name)
+ else
+ ::Gitolite::Config::Repo.new(repo_name)
+ end
+
+ repo.add_permission("RW+", "", owner_name)
+ conf.add_repo(repo, true)
+ ga_repo.save
+ end
end
end
--- /dev/null
+desc "Give gitlab user full access to every repo"
+task :gitlab_enable_automerge => :environment do
+
+ Gitlabhq::GitHost.system.new.configure do |git|
+ git.admin_all_repo
+ end
+
+ puts "Done!".green
+end