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
Léo-Paul Géneau
gitlab-ce
Commits
57e210f6
Commit
57e210f6
authored
Dec 13, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2266 from riyad/improve-status-checks
Improve status checks
parents
fa203e8b
fe608f30
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1055 additions
and
137 deletions
+1055
-137
doc/install/installation.md
doc/install/installation.md
+14
-6
doc/raketasks/maintenance.md
doc/raketasks/maintenance.md
+73
-17
lib/tasks/gitlab/check.rake
lib/tasks/gitlab/check.rake
+959
-0
lib/tasks/gitlab/info.rake
lib/tasks/gitlab/info.rake
+9
-1
lib/tasks/gitlab/status.rake
lib/tasks/gitlab/status.rake
+0
-113
No files found.
doc/install/installation.md
View file @
57e210f6
...
...
@@ -52,14 +52,14 @@ edited by hand. But, you can use any editor you like instead.
Install the required packages:
sudo apt-get install -y
wget curl build-essential checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libreadline6-dev libc6-dev libssl-dev zlib1g-dev libicu-dev redis-server openssh-server git-core libyaml-dev postfix
sudo apt-get install -y
build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev wget curl git-core openssh-server redis-server postfix checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev
Make sure you have the right version of Python installed.
# Install Python
sudo apt-get install python
# Make sure that Python is 2.
x
(3.x is not supported at the moment)
# Make sure that Python is 2.
5+
(3.x is not supported at the moment)
python --version
# If it's Python 3 you might need to install Python 2 separately
...
...
@@ -136,10 +136,10 @@ GitLab assumes *full and unshared* control over this Gitolite installation.
# ... and use it as the admin key for the Gitolite setup
sudo -u git -H sh -c "PATH=/home/git/bin:$PATH; gitolite setup -pk /home/git/gitlab.pub"
Fix the directory permissions for the repositor
y
:
Fix the directory permissions for the repositor
ies
:
# Make sure the repositories dir is owned by git and it stays that way
sudo chmod -R ug+rwXs /home/git/repositories/
sudo chmod -R ug+rwXs
,o-rwx
/home/git/repositories/
sudo chown -R git:git /home/git/repositories/
## Test if everything works so far
...
...
@@ -187,6 +187,12 @@ do so with caution!
# host serving GitLab where necessary
sudo -u gitlab -H vim config/gitlab.yml
# Make sure GitLab can write to the log/ and tmp/ directories
sudo chown -R gitlab log/
sudo chown -R gitlab tmp/
sudo chmod -R u+rwX log/
sudo chmod -R u+rwX tmp/
# Copy the example Unicorn config
sudo -u gitlab -H cp config/unicorn.rb.example config/unicorn.rb
...
...
@@ -209,7 +215,7 @@ used for the `email.from` setting in `config/gitlab.yml`)
sudo -u gitlab -H git config --global user.name "GitLab"
sudo -u gitlab -H git config --global user.email "gitlab@localhost"
## Setup GitLab
h
ooks
## Setup GitLab
H
ooks
sudo cp ./lib/hooks/post-receive /home/git/.gitolite/hooks/common/post-receive
sudo chown git:git /home/git/.gitolite/hooks/common/post-receive
...
...
@@ -227,7 +233,7 @@ Check if GitLab and its environment is configured correctly:
To make sure you didn't miss anything run a more thorough check with:
sudo -u gitlab -H bundle exec rake gitlab:
app:status
RAILS_ENV=production
sudo -u gitlab -H bundle exec rake gitlab:
check
RAILS_ENV=production
If you are all green: congratulations, you successfully installed GitLab!
Although this is the case, there are still a few steps to go.
...
...
@@ -248,6 +254,8 @@ Make GitLab start on boot:
Start your GitLab instance:
sudo service gitlab start
# or
sudo /etc/init.d/gitlab restart
# 7. Nginx
...
...
doc/raketasks/maintenance.md
View file @
57e210f6
...
...
@@ -54,9 +54,18 @@ Git: /usr/bin/git
```
### Check GitLab
installation status
### Check GitLab
configuration
[
Trouble-Shooting-Guide
](
https://github.com/gitlabhq/gitlab-public-wiki/wiki/Trouble-Shooting-Guide
)
Runs the following rake tasks:
*
gitlab:env:check
*
gitlab:gitolite:check
*
gitlab:resque:check
*
gitlab:app:check
It will check that each component was setup according to the installation guide and suggest fixes for issues found.
You may also have a look at our
[
Trouble Shooting Guide
](
https://github.com/gitlabhq/gitlab-public-wiki/wiki/Trouble-Shooting-Guide
)
.
```
bundle exec rake gitlab:check
...
...
@@ -65,21 +74,68 @@ bundle exec rake gitlab:check
Example output:
```
config/database.yml............exists
config/gitlab.yml............exists
/home/git/repositories/............exists
/home/git/repositories/ is writable?............YES
Can clone gitolite-admin?............YES
Can git commit?............YES
UMASK for .gitolite.rc is 0007? ............YES
/home/git/.gitolite/hooks/common/post-receive exists? ............YES
Validating projects repositories:
* abcd.....post-receive file ok
* abcdtest.....post-receive file missing
Finished
Checking Environment ...
gitlab user is in git group? ... yes
Has no "-e" in ~git/.profile ... yes
Git configured for gitlab user? ... yes
Has python2? ... yes
python2 is supported version? ... yes
Checking Environment ... Finished
Checking Gitolite ...
Using recommended version ... yes
Repo umask is 0007 in .gitolite.rc? ... yes
Allow all Git config keys in .gitolite.rc ... yes
Config directory exists? ... yes
Config directory owned by git:git? ... yes
Config directory access is drwxr-x---? ... yes
Repo base directory exists? ... yes
Repo base owned by git:git? ... yes
Repo base access is drwsrws---? ... yes
Can clone gitolite-admin? ... yes
Can commit to gitolite-admin? ... yes
post-receive hook exists? ... yes
post-receive hook up-to-date? ... yes
post-receive hooks in repos are links: ...
GitLab ... ok
Non-Ascii Files Test ... ok
Touch Commit Test ... ok
Without Master Test ... ok
Git config in repos: ...
GitLab ... ok
Non-Ascii Files Test ... ok
Touch Commit Test ... ok
Without Master Test ... ok
Checking Gitolite ... Finished
Checking Resque ...
Running? ... yes
Checking Resque ... Finished
Checking GitLab ...
Database config exists? ... yes
Database is not SQLite ... yes
All migrations up? ... yes
GitLab config exists? ... yes
GitLab config not outdated? ... yes
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
Projects have satellites? ...
GitLab ... yes
Non-Ascii Files Test ... yes
Touch Commit Test ... yes
Without Master Test ... yes
Checking GitLab ... Finished
```
...
...
lib/tasks/gitlab/check.rake
0 → 100644
View file @
57e210f6
This diff is collapsed.
Click to expand it.
lib/tasks/gitlab/info.rake
View file @
57e210f6
...
...
@@ -84,7 +84,13 @@ namespace :gitlab do
# Helper methods
# Runs the given command and matches the output agains the given RegExp
# Runs the given command and matches the output agains the given pattern
#
# Returns nil if nothing matched
# Retunrs the MatchData if the pattern matched
#
# see also #run
# see also String#match
def
run_and_match
(
command
,
regexp
)
run
(
command
).
try
(
:match
,
regexp
)
end
...
...
@@ -93,6 +99,8 @@ namespace :gitlab do
#
# Returns nil if the command was not found
# Returns the output of the command otherwise
#
# see also #run_and_match
def
run
(
command
)
unless
`
#{
command
}
2>/dev/null`
.
blank?
`
#{
command
}
`
...
...
lib/tasks/gitlab/status.rake
deleted
100644 → 0
View file @
fa203e8b
namespace
:gitlab
do
namespace
:app
do
desc
"GITLAB | Check GitLab installation status"
task
:status
=>
:environment
do
puts
"
\n
Starting diagnostics"
.
yellow
git_base_path
=
Gitlab
.
config
.
git_base_path
print
"config/database.yml............"
if
File
.
exists?
(
Rails
.
root
.
join
"config"
,
"database.yml"
)
puts
"exists"
.
green
else
puts
"missing"
.
red
return
end
print
"config/gitlab.yml............"
if
File
.
exists?
(
Rails
.
root
.
join
"config"
,
"gitlab.yml"
)
puts
"exists"
.
green
else
puts
"missing"
.
red
return
end
print
"
#{
git_base_path
}
............"
if
File
.
exists?
(
git_base_path
)
puts
"exists"
.
green
else
puts
"missing"
.
red
return
end
print
"
#{
git_base_path
}
is writable?............"
if
File
.
stat
(
git_base_path
).
writable?
puts
"YES"
.
green
else
puts
"NO"
.
red
return
end
FileUtils
.
rm_rf
(
"/tmp/gitolite_gitlab_test"
)
begin
`git clone -q
#{
Gitlab
.
config
.
gitolite_admin_uri
}
/tmp/gitolite_gitlab_test`
raise
unless
$?
.
success?
print
"Can clone gitolite-admin?............"
puts
"YES"
.
green
rescue
print
"Can clone gitolite-admin?............"
puts
"NO"
.
red
return
end
begin
Dir
.
chdir
(
"/tmp/gitolite_gitlab_test"
)
do
`touch blah && git add blah && git commit -qm blah -- blah`
raise
unless
$?
.
success?
end
print
"Can git commit?............"
puts
"YES"
.
green
rescue
print
"Can git commit?............"
puts
"NO"
.
red
return
ensure
FileUtils
.
rm_rf
(
"/tmp/gitolite_gitlab_test"
)
end
print
"UMASK for .gitolite.rc is 0007? ............"
if
open
(
File
.
absolute_path
(
"
#{
git_base_path
}
/../.gitolite.rc"
)).
grep
(
/UMASK([ \t]*)=([ \t>]*)0007/
).
any?
puts
"YES"
.
green
else
puts
"NO"
.
red
return
end
gitolite_hooks_path
=
File
.
join
(
Gitlab
.
config
.
git_hooks_path
,
"common"
)
gitlab_hook_files
=
[
'post-receive'
]
gitlab_hook_files
.
each
do
|
file_name
|
dest
=
File
.
join
(
gitolite_hooks_path
,
file_name
)
print
"
#{
dest
}
exists? ............"
if
File
.
exists?
(
dest
)
puts
"YES"
.
green
else
puts
"NO"
.
red
return
end
end
if
Project
.
count
>
0
puts
"
\n
Validating projects repositories:"
.
yellow
Project
.
find_each
(
:batch_size
=>
100
)
do
|
project
|
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
next
end
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
puts
"
\n
Finished"
.
blue
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