summaryrefslogtreecommitdiff
path: root/lib/tasks
diff options
context:
space:
mode:
authorVinnie Okada <vokada@mrvinn.com>2015-04-15 22:15:56 -0600
committerVinnie Okada <vokada@mrvinn.com>2015-04-15 22:22:20 -0600
commitacd80bdc2d8aa2c13f2208c90f02ec33a068313c (patch)
tree674c2482183b6b714b0f550d8cfb035abd28183f /lib/tasks
parented94cde2b2b920a38490919597dda7aa706dff62 (diff)
downloadgitlab-ce-acd80bdc2d8aa2c13f2208c90f02ec33a068313c.tar.gz
Add new rake task
Add a task that checks repository integrity with `git fsck`.
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/gitlab/check.rake17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/tasks/gitlab/check.rake b/lib/tasks/gitlab/check.rake
index d791b7155f9..04a2eb12db0 100644
--- a/lib/tasks/gitlab/check.rake
+++ b/lib/tasks/gitlab/check.rake
@@ -687,6 +687,23 @@ namespace :gitlab do
end
end
+ namespace :repo do
+ desc "GITLAB | Check the integrity of the repositories managed by GitLab"
+ task check: :environment do
+ namespace_dirs = Dir.glob(
+ File.join(Gitlab.config.gitlab_shell.repos_path, '*')
+ )
+
+ namespace_dirs.each do |namespace_dir|
+ repo_dirs = Dir.glob(File.join(namespace_dir, '*'))
+ repo_dirs.each do |dir|
+ puts "\nChecking repo at #{dir}"
+ system(*%w(git fsck), chdir: dir)
+ end
+ end
+ end
+ end
+
# Helper methods
##########################