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
fac50387
Commit
fac50387
authored
Feb 01, 2013
by
Riyad Preukschas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port changes from #2803
parent
42dd006d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
38 deletions
+47
-38
lib/tasks/gitlab/check.rake
lib/tasks/gitlab/check.rake
+47
-38
No files found.
lib/tasks/gitlab/check.rake
View file @
fac50387
...
@@ -782,21 +782,25 @@ namespace :gitlab do
...
@@ -782,21 +782,25 @@ namespace :gitlab do
Project
.
find_each
(
batch_size:
100
)
do
|
project
|
Project
.
find_each
(
batch_size:
100
)
do
|
project
|
print
"
#{
project
.
name_with_namespace
.
yellow
}
... "
print
"
#{
project
.
name_with_namespace
.
yellow
}
... "
correct_options
=
options
.
map
do
|
name
,
value
|
if
project
.
empty_repo?
run
(
"git --git-dir=
\"
#{
project
.
repository
.
path_to_repo
}
\"
config --get
#{
name
}
"
).
try
(
:chomp
)
==
value
puts
"repository is empty"
.
magenta
end
if
correct_options
.
all?
puts
"ok"
.
green
else
else
puts
"wrong or missing"
.
red
correct_options
=
options
.
map
do
|
name
,
value
|
try_fixing_it
(
run
(
"git --git-dir=
\"
#{
project
.
repository
.
path_to_repo
}
\"
config --get
#{
name
}
"
).
try
(
:chomp
)
==
value
sudo_gitlab
(
"bundle exec rake gitlab:gitolite:update_repos RAILS_ENV=production"
)
end
)
for_more_information
(
if
correct_options
.
all?
"doc/raketasks/maintenance.md"
puts
"ok"
.
green
)
else
fix_and_rerun
puts
"wrong or missing"
.
red
try_fixing_it
(
sudo_gitlab
(
"bundle exec rake gitlab:gitolite:update_repos RAILS_ENV=production"
)
)
for_more_information
(
"doc/raketasks/maintenance.md"
)
fix_and_rerun
end
end
end
end
end
end
end
...
@@ -822,32 +826,37 @@ namespace :gitlab do
...
@@ -822,32 +826,37 @@ namespace :gitlab do
Project
.
find_each
(
batch_size:
100
)
do
|
project
|
Project
.
find_each
(
batch_size:
100
)
do
|
project
|
print
"
#{
project
.
name_with_namespace
.
yellow
}
... "
print
"
#{
project
.
name_with_namespace
.
yellow
}
... "
project_hook_file
=
File
.
join
(
project
.
repository
.
path_to_repo
,
"hooks"
,
hook_file
)
unless
File
.
exists?
(
project_hook_file
)
if
project
.
empty_repo?
puts
"missing"
.
red
puts
"repository is empty"
.
magenta
try_fixing_it
(
"sudo -u
#{
gitolite_ssh_user
}
ln -sf
#{
gitolite_hook_file
}
#{
project_hook_file
}
"
)
for_more_information
(
"lib/support/rewrite-hooks.sh"
)
fix_and_rerun
next
end
if
File
.
lstat
(
project_hook_file
).
symlink?
&&
File
.
realpath
(
project_hook_file
)
==
File
.
realpath
(
gitolite_hook_file
)
puts
"ok"
.
green
else
else
puts
"not a link to Gitolite's hook"
.
red
project_hook_file
=
File
.
join
(
project
.
repository
.
path_to_repo
,
"hooks"
,
hook_file
)
try_fixing_it
(
"sudo -u
#{
gitolite_ssh_user
}
ln -sf
#{
gitolite_hook_file
}
#{
project_hook_file
}
"
unless
File
.
exists?
(
project_hook_file
)
)
puts
"missing"
.
red
for_more_information
(
try_fixing_it
(
"lib/support/rewrite-hooks.sh"
"sudo -u
#{
gitolite_ssh_user
}
ln -sf
#{
gitolite_hook_file
}
#{
project_hook_file
}
"
)
)
fix_and_rerun
for_more_information
(
"lib/support/rewrite-hooks.sh"
)
fix_and_rerun
next
end
if
File
.
lstat
(
project_hook_file
).
symlink?
&&
File
.
realpath
(
project_hook_file
)
==
File
.
realpath
(
gitolite_hook_file
)
puts
"ok"
.
green
else
puts
"not a link to Gitolite's hook"
.
red
try_fixing_it
(
"sudo -u
#{
gitolite_ssh_user
}
ln -sf
#{
gitolite_hook_file
}
#{
project_hook_file
}
"
)
for_more_information
(
"lib/support/rewrite-hooks.sh"
)
fix_and_rerun
end
end
end
end
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