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
d74b8b45
Commit
d74b8b45
authored
May 02, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'pkgr-improve-gitlab-shell-installation'
parents
b2a25872
dd47f953
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
30 deletions
+83
-30
doc/install/installation.md
doc/install/installation.md
+24
-30
lib/tasks/gitlab/shell.rake
lib/tasks/gitlab/shell.rake
+59
-0
No files found.
doc/install/installation.md
View file @
d74b8b45
...
@@ -27,10 +27,9 @@ The GitLab installation consists of setting up the following components:
...
@@ -27,10 +27,9 @@ The GitLab installation consists of setting up the following components:
1.
Packages / Dependencies
1.
Packages / Dependencies
2.
Ruby
2.
Ruby
3.
System Users
3.
System Users
4.
GitLab shell
4.
Database
5.
Database
5.
GitLab
6.
GitLab
6.
Nginx
7.
Nginx
# 1. Packages / Dependencies
# 1. Packages / Dependencies
...
@@ -119,30 +118,7 @@ Create a `git` user for Gitlab:
...
@@ -119,30 +118,7 @@ Create a `git` user for Gitlab:
sudo adduser --disabled-login --gecos 'GitLab' git
sudo adduser --disabled-login --gecos 'GitLab' git
# 4. Database
# 4. GitLab shell
GitLab Shell is an ssh access and repository management software developed specially for GitLab.
# Go to home directory
cd /home/git
# Clone gitlab shell
sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-shell.git -b v1.9.3
cd gitlab-shell
sudo -u git -H cp config.yml.example config.yml
# Edit config and replace gitlab_url
# with something like 'http://domain.com/'
sudo -u git -H editor config.yml
# Do setup
sudo -u git -H ./bin/install
# 5. Database
We recommend using a PostgreSQL database. For MySQL check
[
MySQL setup guide
](
database_mysql.md
)
.
We recommend using a PostgreSQL database. For MySQL check
[
MySQL setup guide
](
database_mysql.md
)
.
...
@@ -165,7 +141,7 @@ We recommend using a PostgreSQL database. For MySQL check [MySQL setup guide](da
...
@@ -165,7 +141,7 @@ We recommend using a PostgreSQL database. For MySQL check [MySQL setup guide](da
sudo -u git -H psql -d gitlabhq_production
sudo -u git -H psql -d gitlabhq_production
#
6
. GitLab
#
5
. GitLab
# We'll install GitLab into home directory of the user "git"
# We'll install GitLab into home directory of the user "git"
cd /home/git
cd /home/git
...
@@ -276,6 +252,18 @@ that were [fixed](https://github.com/bundler/bundler/pull/2817) in 1.5.2.
...
@@ -276,6 +252,18 @@ that were [fixed](https://github.com/bundler/bundler/pull/2817) in 1.5.2.
# When done you see 'Administrator account created:'
# When done you see 'Administrator account created:'
## Install GitLab shell
GitLab Shell is an ssh access and repository management software developed specially for GitLab.
# Go to the Gitlab installation folder:
cd /home/git/gitlab
# Run the installation task for gitlab-shell (replace `REDIS_URL` if needed):
sudo -u git -H bundle exec rake gitlab:shell:install[v1.9.3] REDIS_URL=redis://localhost:6379
# By default, the gitlab-shell config is generated from your main gitlab config. You can review (and modify) it as follows:
sudo -u git -H editor /home/git/gitlab-shell/config.yml
## Install Init Script
## Install Init Script
...
@@ -313,7 +301,13 @@ Check if GitLab and its environment are configured correctly:
...
@@ -313,7 +301,13 @@ Check if GitLab and its environment are configured correctly:
# or
# or
sudo /etc/init.d/gitlab restart
sudo /etc/init.d/gitlab restart
# 7. Nginx
## Compile assets
sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=production
# 6. Nginx
**Note:**
**Note:**
Nginx is the officially supported web server for GitLab. If you cannot or do not want to use Nginx as your web server, have a look at the
Nginx is the officially supported web server for GitLab. If you cannot or do not want to use Nginx as your web server, have a look at the
...
...
lib/tasks/gitlab/shell.rake
View file @
d74b8b45
namespace
:gitlab
do
namespace
:gitlab
do
namespace
:shell
do
namespace
:shell
do
desc
"GITLAB | Install or upgrade gitlab-shell"
task
:install
,
[
:tag
,
:repo
]
=>
:environment
do
|
t
,
args
|
warn_user_is_not_gitlab
args
.
with_defaults
(
tag:
"v1.9.1"
,
repo:
"https://gitlab.com/gitlab-org/gitlab-shell.git"
)
user
=
Settings
.
gitlab
.
user
home_dir
=
Settings
.
gitlab
.
user_home
gitlab_url
=
Settings
.
gitlab
.
url
# gitlab-shell requires a / at the end of the url
gitlab_url
+=
"/"
unless
gitlab_url
.
match
(
/\/$/
)
repos_path
=
Gitlab
.
config
.
gitlab_shell
.
repos_path
target_dir
=
Gitlab
.
config
.
gitlab_shell
.
path
# Clone if needed
unless
File
.
directory?
(
target_dir
)
sh
"git clone '
#{
args
.
repo
}
' '
#{
target_dir
}
'"
end
# Make sure we're on the right tag
Dir
.
chdir
(
target_dir
)
do
sh
"git fetch origin && git reset --hard $(git describe
#{
args
.
tag
}
|| git describe origin/
#{
args
.
tag
}
)"
redis_url
=
URI
.
parse
(
ENV
[
'REDIS_URL'
]
||
"redis://localhost:6379"
)
config
=
{
user:
user
,
gitlab_url:
gitlab_url
,
http_settings:
{
self_signed_cert:
false
},
repos_path:
repos_path
,
auth_file:
File
.
join
(
home_dir
,
".ssh"
,
"authorized_keys"
),
redis:
{
bin:
%x{which redis-cli}
.
chomp
,
host:
redis_url
.
host
,
port:
redis_url
.
port
,
namespace:
"resque:gitlab"
},
log_level:
"INFO"
,
audit_usernames:
false
}.
stringify_keys
# Generate config.yml based on existing gitlab settings
File
.
open
(
"config.yml"
,
"w+"
)
{
|
f
|
f
.
puts
config
.
to_yaml
}
# Launch installation process
sh
"bin/install"
end
# Required for debian packaging with PKGR: Setup .ssh/environment with
# the current PATH, so that the correct ruby version gets loaded
# Requires to set "PermitUserEnvironment yes" in sshd config (should not
# be an issue since it is more than likely that there are no "normal"
# user accounts on a gitlab server). The alternative is for the admin to
# install a ruby (1.9.3+) in the global path.
File
.
open
(
File
.
join
(
home_dir
,
".ssh"
,
"environment"
),
"w+"
)
do
|
f
|
f
.
puts
"PATH=
#{
ENV
[
'PATH'
]
}
"
end
end
desc
"GITLAB | Setup gitlab-shell"
desc
"GITLAB | Setup gitlab-shell"
task
setup: :environment
do
task
setup: :environment
do
setup
setup
...
...
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