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
Boxiang Sun
gitlab-ce
Commits
cb6d7e51
Commit
cb6d7e51
authored
Sep 12, 2013
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rescue an error if group doesn't exist
parent
7bf8d22f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
lib/tasks/gitlab/check.rake
lib/tasks/gitlab/check.rake
+4
-2
lib/tasks/gitlab/task_helpers.rake
lib/tasks/gitlab/task_helpers.rake
+5
-1
No files found.
lib/tasks/gitlab/check.rake
View file @
cb6d7e51
...
@@ -479,11 +479,13 @@ namespace :gitlab do
...
@@ -479,11 +479,13 @@ namespace :gitlab do
return
return
end
end
if
File
.
stat
(
repo_base_path
).
uid
==
uid_for
(
gitlab_shell_ssh_user
)
&&
uid
=
uid_for
(
gitlab_shell_ssh_user
)
File
.
stat
(
repo_base_path
).
gid
==
gid_for
(
gitlab_shell_owner_group
)
gid
=
gid_for
(
gitlab_shell_owner_group
)
if
File
.
stat
(
repo_base_path
).
uid
==
uid
&&
File
.
stat
(
repo_base_path
).
gid
==
gid
puts
"yes"
.
green
puts
"yes"
.
green
else
else
puts
"no"
.
red
puts
"no"
.
red
puts
" User id for
#{
gitlab_shell_ssh_user
}
:
#{
uid
}
. Groupd id for
#{
gitlab_shell_owner_group
}
:
#{
gid
}
"
.
blue
try_fixing_it
(
try_fixing_it
(
"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
}
"
)
)
...
...
lib/tasks/gitlab/task_helpers.rake
View file @
cb6d7e51
...
@@ -80,7 +80,11 @@ namespace :gitlab do
...
@@ -80,7 +80,11 @@ namespace :gitlab do
end
end
def
gid_for
(
group_name
)
def
gid_for
(
group_name
)
Etc
.
getgrnam
(
group_name
).
gid
begin
Etc
.
getgrnam
(
group_name
).
gid
rescue
ArgumentError
# no group
"group
#{
group_name
}
doesn't exist"
end
end
end
def
warn_user_is_not_gitlab
def
warn_user_is_not_gitlab
...
...
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