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
Jérome Perrin
gitlab-ce
Commits
6b96ca47
Commit
6b96ca47
authored
Feb 12, 2013
by
Martin Bastien
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some fix for gitlab:gitlab_shell:check
Fixing issue #2970
parent
d6513b51
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
30 deletions
+15
-30
lib/tasks/gitlab/check.rake
lib/tasks/gitlab/check.rake
+15
-30
No files found.
lib/tasks/gitlab/check.rake
View file @
6b96ca47
...
@@ -311,7 +311,7 @@ namespace :gitlab do
...
@@ -311,7 +311,7 @@ namespace :gitlab do
"Remove
\"
-e
\"
so the line starts with PATH"
"Remove
\"
-e
\"
so the line starts with PATH"
)
)
for_more_information
(
for_more_information
(
see_installation_guide_section
(
"Git
olite
"
),
see_installation_guide_section
(
"Git
lab Shell
"
),
"https://github.com/gitlabhq/gitlabhq/issues/1059"
"https://github.com/gitlabhq/gitlabhq/issues/1059"
)
)
fix_and_rerun
fix_and_rerun
...
@@ -368,10 +368,10 @@ namespace :gitlab do
...
@@ -368,10 +368,10 @@ namespace :gitlab do
namespace
:gitlab_shell
do
namespace
:gitlab_shell
do
desc
"GITLAB | Check the configuration of Git
olite
"
desc
"GITLAB | Check the configuration of Git
lab Shell
"
task
check: :environment
do
task
check: :environment
do
warn_user_is_not_gitlab
warn_user_is_not_gitlab
start_checking
"Git
olite
"
start_checking
"Git
lab Shell
"
check_repo_base_exists
check_repo_base_exists
check_repo_base_is_not_symlink
check_repo_base_is_not_symlink
...
@@ -380,7 +380,7 @@ namespace :gitlab do
...
@@ -380,7 +380,7 @@ namespace :gitlab do
check_post_receive_hook_is_up_to_date
check_post_receive_hook_is_up_to_date
check_repos_post_receive_hooks_is_link
check_repos_post_receive_hooks_is_link
finished_checking
"Git
olite
"
finished_checking
"Git
lab Shell
"
end
end
...
@@ -392,7 +392,7 @@ namespace :gitlab do
...
@@ -392,7 +392,7 @@ namespace :gitlab do
print
"post-receive hook up-to-date? ... "
print
"post-receive hook up-to-date? ... "
hook_file
=
"post-receive"
hook_file
=
"post-receive"
gitlab_shell_hooks_path
=
File
.
join
(
Gitlab
.
config
.
gitlab_shell
.
hooks_path
,
"common"
)
gitlab_shell_hooks_path
=
Gitlab
.
config
.
gitlab_shell
.
hooks_path
gitlab_shell_hook_file
=
File
.
join
(
gitlab_shell_hooks_path
,
hook_file
)
gitlab_shell_hook_file
=
File
.
join
(
gitlab_shell_hooks_path
,
hook_file
)
gitlab_shell_ssh_user
=
Gitlab
.
config
.
gitlab_shell
.
ssh_user
gitlab_shell_ssh_user
=
Gitlab
.
config
.
gitlab_shell
.
ssh_user
...
@@ -401,22 +401,7 @@ namespace :gitlab do
...
@@ -401,22 +401,7 @@ namespace :gitlab do
return
return
end
end
gitlab_shell_hook_content
=
File
.
read
(
gitlab_shell_hook_file
)
gitlab_hook_file
=
Rails
.
root
.
join
.
join
(
"lib"
,
"hooks"
,
hook_file
)
gitlab_hook_content
=
File
.
read
(
gitlab_hook_file
)
if
gitlab_shell_hook_content
==
gitlab_hook_content
puts
"yes"
.
green
puts
"yes"
.
green
else
puts
"no"
.
red
try_fixing_it
(
"sudo -u
#{
gitlab_shell_ssh_user
}
cp
#{
gitlab_hook_file
}
#{
gitlab_shell_hook_file
}
"
)
for_more_information
(
see_installation_guide_section
"Setup GitLab Hooks"
)
fix_and_rerun
end
end
end
def
check_repo_base_exists
def
check_repo_base_exists
...
@@ -430,12 +415,12 @@ namespace :gitlab do
...
@@ -430,12 +415,12 @@ namespace :gitlab do
puts
"no"
.
red
puts
"no"
.
red
puts
"
#{
repo_base_path
}
is missing"
.
red
puts
"
#{
repo_base_path
}
is missing"
.
red
try_fixing_it
(
try_fixing_it
(
"This should have been created when setting up Git
olite
."
,
"This should have been created when setting up Git
lab Shell
."
,
"Make sure it's set correctly in config/gitlab.yml"
,
"Make sure it's set correctly in config/gitlab.yml"
,
"Make sure Git
olite
is installed correctly."
"Make sure Git
lab Shell
is installed correctly."
)
)
for_more_information
(
for_more_information
(
see_installation_guide_section
"Git
olite
"
see_installation_guide_section
"Git
lab Shell
"
)
)
fix_and_rerun
fix_and_rerun
end
end
...
@@ -480,7 +465,7 @@ namespace :gitlab do
...
@@ -480,7 +465,7 @@ namespace :gitlab do
"find
#{
repo_base_path
}
-type d -print0 | sudo xargs -0 chmod g+s"
"find
#{
repo_base_path
}
-type d -print0 | sudo xargs -0 chmod g+s"
)
)
for_more_information
(
for_more_information
(
see_installation_guide_section
"Git
olite
"
see_installation_guide_section
"Git
lab Shell
"
)
)
fix_and_rerun
fix_and_rerun
end
end
...
@@ -506,7 +491,7 @@ namespace :gitlab do
...
@@ -506,7 +491,7 @@ namespace :gitlab do
"sudo chown -R
#{
gitlab_shell_ssh_user
}
:
#{
gitlab_shell_owner_group
}
#{
repo_base_path
}
"
"sudo chown -R
#{
gitlab_shell_ssh_user
}
:
#{
gitlab_shell_owner_group
}
#{
repo_base_path
}
"
)
)
for_more_information
(
for_more_information
(
see_installation_guide_section
"Git
olite
"
see_installation_guide_section
"Git
lab Shell
"
)
)
fix_and_rerun
fix_and_rerun
end
end
...
@@ -516,7 +501,7 @@ namespace :gitlab do
...
@@ -516,7 +501,7 @@ namespace :gitlab do
print
"post-receive hooks in repos are links: ... "
print
"post-receive hooks in repos are links: ... "
hook_file
=
"post-receive"
hook_file
=
"post-receive"
gitlab_shell_hooks_path
=
File
.
join
(
Gitlab
.
config
.
gitlab_shell
.
hooks_path
,
"common"
)
gitlab_shell_hooks_path
=
Gitlab
.
config
.
gitlab_shell
.
hooks_path
gitlab_shell_hook_file
=
File
.
join
(
gitlab_shell_hooks_path
,
hook_file
)
gitlab_shell_hook_file
=
File
.
join
(
gitlab_shell_hooks_path
,
hook_file
)
gitlab_shell_ssh_user
=
Gitlab
.
config
.
gitlab_shell
.
ssh_user
gitlab_shell_ssh_user
=
Gitlab
.
config
.
gitlab_shell
.
ssh_user
...
@@ -545,7 +530,7 @@ namespace :gitlab do
...
@@ -545,7 +530,7 @@ namespace :gitlab do
"sudo -u
#{
gitlab_shell_ssh_user
}
ln -sf
#{
gitlab_shell_hook_file
}
#{
project_hook_file
}
"
"sudo -u
#{
gitlab_shell_ssh_user
}
ln -sf
#{
gitlab_shell_hook_file
}
#{
project_hook_file
}
"
)
)
for_more_information
(
for_more_information
(
"
lib
/support/rewrite-hooks.sh"
"
#{
gitlab_shell_user_home
}
/support/rewrite-hooks.sh"
)
)
fix_and_rerun
fix_and_rerun
next
next
...
@@ -555,7 +540,7 @@ namespace :gitlab do
...
@@ -555,7 +540,7 @@ namespace :gitlab do
File
.
realpath
(
project_hook_file
)
==
File
.
realpath
(
gitlab_shell_hook_file
)
File
.
realpath
(
project_hook_file
)
==
File
.
realpath
(
gitlab_shell_hook_file
)
puts
"ok"
.
green
puts
"ok"
.
green
else
else
puts
"not a link to Git
olite
's hook"
.
red
puts
"not a link to Git
lab Shell
's hook"
.
red
try_fixing_it
(
try_fixing_it
(
"sudo -u
#{
gitlab_shell_ssh_user
}
ln -sf
#{
gitlab_shell_hook_file
}
#{
project_hook_file
}
"
"sudo -u
#{
gitlab_shell_ssh_user
}
ln -sf
#{
gitlab_shell_hook_file
}
#{
project_hook_file
}
"
)
)
...
@@ -577,7 +562,7 @@ namespace :gitlab do
...
@@ -577,7 +562,7 @@ namespace :gitlab do
end
end
def
gitlab_shell_version
def
gitlab_shell_version
gitlab_shell_version_file
=
"
#{
gitlab_shell_user_home
}
/
gitlab_shell/src/
VERSION"
gitlab_shell_version_file
=
"
#{
gitlab_shell_user_home
}
/VERSION"
if
File
.
readable?
(
gitlab_shell_version_file
)
if
File
.
readable?
(
gitlab_shell_version_file
)
File
.
read
(
gitlab_shell_version_file
)
File
.
read
(
gitlab_shell_version_file
)
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