BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
6ee122c0
Commit
6ee122c0
authored
Jan 03, 2018
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deprecate check integrity task
parent
5b9e7773
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
39 deletions
+2
-39
check.rake
lib/tasks/gitlab/check.rake
+2
-39
No files found.
lib/tasks/gitlab/check.rake
View file @
6ee122c0
...
...
@@ -387,14 +387,8 @@ namespace :gitlab do
namespace
:repo
do
desc
"GitLab | Check the integrity of the repositories managed by GitLab"
task
check: :environment
do
Gitlab
.
config
.
repositories
.
storages
.
each
do
|
name
,
repository_storage
|
namespace_dirs
=
Dir
.
glob
(
File
.
join
(
repository_storage
[
'path'
],
'*'
))
namespace_dirs
.
each
do
|
namespace_dir
|
repo_dirs
=
Dir
.
glob
(
File
.
join
(
namespace_dir
,
'*'
))
repo_dirs
.
each
{
|
repo_dir
|
check_repo_integrity
(
repo_dir
)
}
end
end
puts
"This task is deprecated. Please use gitlab:git:fsck instead"
.
color
(
:red
)
Rake
::
Task
[
"gitlab:git:fsck"
].
execute
end
end
...
...
@@ -461,35 +455,4 @@ namespace :gitlab do
puts
"FAIL. Please update gitlab-shell to
#{
required_version
}
from
#{
current_version
}
"
.
color
(
:red
)
end
end
def
check_repo_integrity
(
repo_dir
)
puts
"
\n
Checking repo at
#{
repo_dir
.
color
(
:yellow
)
}
"
git_fsck
(
repo_dir
)
check_config_lock
(
repo_dir
)
check_ref_locks
(
repo_dir
)
end
def
git_fsck
(
repo_dir
)
puts
"Running `git fsck`"
.
color
(
:yellow
)
system
(
*
%W(
#{
Gitlab
.
config
.
git
.
bin_path
}
fsck)
,
chdir:
repo_dir
)
end
def
check_config_lock
(
repo_dir
)
config_exists
=
File
.
exist?
(
File
.
join
(
repo_dir
,
'config.lock'
))
config_output
=
config_exists
?
'yes'
.
color
(:
red
)
:
'no'
.
color
(
:green
)
puts
"'config.lock' file exists?"
.
color
(
:yellow
)
+
" ...
#{
config_output
}
"
end
def
check_ref_locks
(
repo_dir
)
lock_files
=
Dir
.
glob
(
File
.
join
(
repo_dir
,
'refs/heads/*.lock'
))
if
lock_files
.
present?
puts
"Ref lock files exist:"
.
color
(
:red
)
lock_files
.
each
do
|
lock_file
|
puts
"
#{
lock_file
}
"
end
else
puts
"No ref lock files exist"
.
color
(
:green
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment