Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
3ab33fcf
Commit
3ab33fcf
authored
Nov 21, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add post-receive file content validation
parent
b39002ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
lib/tasks/gitlab/status.rake
lib/tasks/gitlab/status.rake
+12
-5
No files found.
lib/tasks/gitlab/status.rake
View file @
3ab33fcf
...
...
@@ -2,7 +2,7 @@ namespace :gitlab do
namespace
:app
do
desc
"GITLAB | Check GitLab installation status"
task
:status
=>
:environment
do
puts
"Starting diagnostics"
.
yellow
puts
"
\n
Starting diagnostics"
.
yellow
git_base_path
=
Gitlab
.
config
.
git_base_path
print
"config/database.yml............"
...
...
@@ -86,17 +86,24 @@ namespace :gitlab do
end
if
Project
.
count
>
0
puts
"Validating projects repositories:"
.
yellow
puts
"
\n
Validating projects repositories:"
.
yellow
Project
.
find_each
(
:batch_size
=>
100
)
do
|
project
|
print
"
#{
project
.
name
}
....."
print
"
*
#{
project
.
name
}
....."
hook_file
=
File
.
join
(
project
.
path_to_repo
,
'hooks'
,
'post-receive'
)
unless
File
.
exists?
(
hook_file
)
puts
"post-receive file missing"
.
red
return
next
end
puts
"post-receive file ok"
.
green
original_content
=
File
.
read
(
Rails
.
root
.
join
(
'lib'
,
'hooks'
,
'post-receive'
))
new_content
=
File
.
read
(
hook_file
)
if
original_content
==
new_content
puts
"post-receive file ok"
.
green
else
puts
"post-receive file content does not match"
.
red
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