Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
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
Kazuhiko Shiozaki
gitlab-shell
Commits
43a55494
Commit
43a55494
authored
Feb 05, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add check bin
parent
e7a4d233
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
0 deletions
+43
-0
bin/check
bin/check
+31
-0
bin/install
bin/install
+1
-0
config.yml.example
config.yml.example
+7
-0
lib/gitlab_net.rb
lib/gitlab_net.rb
+4
-0
No files found.
bin/check
0 → 100755
View file @
43a55494
#!/usr/bin/env ruby
require_relative
'../lib/gitlab_init'
require_relative
'../lib/gitlab_net'
#
# GitLab shell check task
#
print
"Check GitLab API access: "
resp
=
GitlabNet
.
new
.
check
if
resp
.
code
==
"200"
print
'OK'
else
puts
"FAILED. code:
#{
resp
.
code
}
"
end
puts
"
\n
Check directories and files: "
config
=
GitlabConfig
.
new
dirs
=
[
config
.
repos_path
,
config
.
auth_file
]
dirs
.
each
do
|
dir
|
print
"
\t
#{
dir
}
: "
if
File
.
exists?
(
dir
)
print
'OK'
else
puts
"FAILED"
end
puts
"
\n
"
end
bin/install
View file @
43a55494
...
@@ -9,6 +9,7 @@ require_relative '../lib/gitlab_init'
...
@@ -9,6 +9,7 @@ require_relative '../lib/gitlab_init'
commands
=
[
commands
=
[
"mkdir -p /home/git/repositories"
,
"mkdir -p /home/git/repositories"
,
"mkdir -p /home/git/.ssh"
,
"mkdir -p /home/git/.ssh"
,
"touch /home/git/.ssh/authorized_keys"
,
"chmod -R ug+rwX,o-rwx /home/git/repositories/"
,
"chmod -R ug+rwX,o-rwx /home/git/repositories/"
,
"find /home/git/repositories -type d -print0 | xargs -0 chmod g+s"
"find /home/git/repositories -type d -print0 | xargs -0 chmod g+s"
]
]
...
...
config.yml.example
View file @
43a55494
# GitLab user. git by default
user: git
user: git
# Url to gitlab instance. Used for api calls
gitlab_url: "http://localhost/"
gitlab_url: "http://localhost/"
# Repositories path
repos_path: "/home/git/repositories"
repos_path: "/home/git/repositories"
# File used as authorized_keys for gitlab user
auth_file: "/home/git/.ssh/authorized_keys"
auth_file: "/home/git/.ssh/authorized_keys"
lib/gitlab_net.rb
View file @
43a55494
...
@@ -22,6 +22,10 @@ class GitlabNet
...
@@ -22,6 +22,10 @@ class GitlabNet
JSON
.
parse
(
resp
.
body
)
JSON
.
parse
(
resp
.
body
)
end
end
def
check
get
(
"
#{
host
}
/check"
)
end
protected
protected
def
host
def
host
...
...
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