Skip to content

Commit 1829ee3

Browse files
committed
Merge pull request #111 from gitlabhq/new_structure
New repository structure
2 parents f74b43a + b614352 commit 1829ee3

35 files changed

+1376
-592
lines changed

Diff for: CONTRIBUTING.md

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Contribute to GitLab recipes
2+
3+
This guide details how to use issues and pull requests to improve GitLab recipes.
4+
5+
Please stick as close as possible to the guidelines. That way we ensure quality guides
6+
and easy to merge requests.
7+
8+
Your Pull Request will be reviewed by one of our devs/volunteers and you will be
9+
asked to reformat it if needed. We don't bite and we will try to be as flexible
10+
as possible, so don't get intimidated by the extent of the quidelines :)
11+
12+
For better maintainance and clarity, some naming guidelines should be followed.
13+
See details in each section below.
14+
15+
## Pull Request title
16+
17+
Try to be as more descriptive as you can in your Pull Request title.
18+
19+
Particularly if you are submitting a new script or guide, include in the title,
20+
information about GitLab version, OS tested on and any other relevant info.
21+
22+
For example some good titles would be:
23+
24+
* [Installation script] GitLab 6.x - Ubuntu 12.04 - Apache
25+
* [Guide] GitLab 6.1 - FreeBSD - postrges, rvm
26+
27+
## Guides
28+
29+
Each installation guide has its own namespace and it should be provided in a
30+
`README` file so that it renders first when viewing the repository. Submit a new
31+
one in `install/platform/README.md` (it doesn't have to be strictly in markdown though).
32+
33+
## Scripts
34+
35+
Installation scripts reside in `install/platform/scripts/`, so if you have one,
36+
submit it there. They should named after the following scheme: `platform-platform_version`.
37+
38+
Example: `ubuntu-server-12.04.sh`
39+
40+
You are strongly encouraged to also provide a `README` file that describes
41+
how to use the script. You may have included all the needed info in the script
42+
itself (recommended), so you could simply write something between the lines:
43+
44+
> This script installs GitLab 6.0 on Archlinux. Run it with `./archlinux.sh your_domain_name`
45+
>
46+
> For more info and variables you can change, read the comments in the script.
47+
48+
49+
### Scripts doing similar things
50+
51+
There is a strong possibility that your script will do similar things to what a
52+
script already in this repo do. In that case, please work on the existing script
53+
and enhance it with your changes. No need to duplicate things.
54+
55+
## What information to put on your guide/script etc (mandatory)
56+
57+
If you have an installation guide to provide, fill in the template and place it on top
58+
of it or include it in your installation script (commented), again on top. Try to
59+
include as many items of this template as you can.
60+
61+
### Template
62+
63+
```
64+
Distribution :
65+
GitLab version :
66+
Web Server :
67+
Init system :
68+
Database :
69+
Contributors :
70+
Additional Notes :
71+
```
72+
73+
### Explanation
74+
75+
| Label | Explanation |
76+
| ---------------- | ------------------------- |
77+
| Distribution | The official name and version of the platform/distribution, case sensitive. |
78+
| GitLab version | GitLab version on which the guide/script was tested. |
79+
| Web Server | The web server used to serve GitLab. May be two-fold, eg. apache with mod_passenger. |
80+
| Init system | (Optional but recommended) The init system used by the platform if any. Examples: `sysvinit`, `systemd`, `upstart`, `openrc`, etc |
81+
| Database | The database used for installation. Examples: `mysql`, `postrgres`, `mariadb`.
82+
| Contributors | Your github username (recommended in order to track you and give credits) or your real name or both. Example of the latter: **thedude (Jeffrey Lebowski)** |
83+
| Additional Notes | Anything else you want to add. Any deviations form the official guide can be reported here. Eg. using rvm for ruby install, storing in different locations, etc.|
84+
85+
86+
### Example
87+
88+
```
89+
Distribution : Fedora 19
90+
GitLab version : 5.4
91+
Web Server : apache with mod_passenger
92+
Init system : systemd
93+
Database : mariadb
94+
Contributors : thedude
95+
Additional Notes : the script uses rvm to install ruby
96+
```

Diff for: README.md

+13-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
gitlab-recipes
2-
==============
1+
## GitLab recipes: unofficial guides for using GitLab with different software
32

4-
GitLab recipes for setup on different platforms, update etc...
3+
Here you will find unofficial guides for using GitLab with different software (operating systems, web servers, etc.)
4+
provided by the community, for systems other than the officially supported (Debian/Ubuntu).
55

6-
### Every file should have section with maintainer name & gitlab version:
6+
Bare in mind that this repository is co-maintained by volunteers/contributors like you.
77

8-
# GITLAB
9-
# Maintainer: @randx
10-
# App Version: 5.0
8+
## Contributing
9+
10+
See [contributing.md](CONTRIBUTING.md) for contribution guidelines.
11+
12+
## Notes on the reliability of guides/scripts
13+
14+
* We will try to test everything before accepting PRs, in a clean, newly installed platform.
15+
* You should read a script and understand what it does prior to running it.
16+
* If something goes wrong during installation and you think the guide/script needs fixing, file a bug report or a submit a Pull Request.

Diff for: apache/gitlab

-36
This file was deleted.

Diff for: app-server/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
In this section there are provided additional configuration files for various application servers.
2+
3+
If you have something to contribute please read the [contributing guidelines](../contributing.md).

Diff for: app-server/puma/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Alternative configuration file for the `puma` application server. Copy it under `/home/git/gitlab/config/`.

Diff for: app-server/puma/puma.rb

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
#!/usr/bin/env puma
2+
3+
# Start Puma with next command:
4+
# RAILS_ENV=production bundle exec puma -C ./config/puma.rb
5+
6+
# uncomment and customize to run in non-root path
7+
# note that config/gitlab.yml web path should also be changed
8+
# ENV['RAILS_RELATIVE_URL_ROOT'] = "/gitlab"
9+
10+
application_path = '/home/git/gitlab'
11+
directory application_path
12+
environment 'production'
13+
daemonize true
14+
pidfile "#{application_path}/tmp/pids/puma.pid"
15+
state_path "#{application_path}/tmp/pids/puma.state"
16+
stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log"
17+
18+
# Configure “min” to be the minimum number of threads to use to answer
19+
# requests and “max” the maximum.
20+
#
21+
# The default is “0, 16”.
22+
#
23+
# threads 0, 16
24+
25+
# Bind the server to “url”. “tcp://”, “unix://” and “ssl://” are the only
26+
# accepted protocols.
27+
#
28+
#
29+
# The default is “tcp://0.0.0.0:9292”.
30+
#
31+
# bind 'tcp://0.0.0.0:9292'
32+
# bind 'unix:///var/run/puma.sock'
33+
# bind 'unix:///var/run/puma.sock?umask=0777'
34+
# bind 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert'
35+
#
36+
## Comment the next line if you use apache.
37+
bind "unix://#{application_path}/tmp/sockets/gitlab.socket"
38+
39+
# Instead of “bind 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert'” you
40+
# can also use the “ssl_bind” option.
41+
#
42+
# ssl_bind '127.0.0.1', '9292', { key: path_to_key, cert: path_to_cert }
43+
44+
# Code to run before doing a restart. This code should
45+
# close log files, database connections, etc.
46+
#
47+
# This can be called multiple times to add code each time.
48+
#
49+
# on_restart do
50+
# puts 'On restart...'
51+
# end
52+
53+
# Command to use to restart puma. This should be just how to
54+
# load puma itself (ie. 'ruby -Ilib bin/puma'), not the arguments
55+
# to puma, as those are the same as the original process.
56+
#
57+
# restart_command '/u/app/lolcat/bin/restart_puma'
58+
59+
# === Cluster mode ===
60+
61+
# How many worker processes to run.
62+
#
63+
# The default is “0”.
64+
#
65+
# workers 2
66+
67+
# GitLab cluster mode recommendations
68+
# If you have more than 1 GB RAM, uncomment one of the following lines:
69+
#
70+
# workers 2 # if you have at least 1.5 GB RAM
71+
# workers 3 # if you have at least 2 GB RAM
72+
# workers 4 # if you have at least 2.5 GB RAM
73+
74+
# Code to run when a worker boots to setup the process before booting
75+
# the app.
76+
#
77+
# This can be called multiple times to add hooks.
78+
#
79+
# on_worker_boot do
80+
# puts 'On worker boot...'
81+
# end
82+
83+
# === Puma control rack application ===
84+
85+
# Start the puma control rack application on “url”. This application can
86+
# be communicated with to control the main server. Additionally, you can
87+
# provide an authentication token, so all requests to the control server
88+
# will need to include that token as a query parameter. This allows for
89+
# simple authentication.
90+
#
91+
# Check out https://github.com/puma/puma/blob/master/lib/puma/app/status.rb
92+
# to see what the app has available.
93+
#
94+
# activate_control_app 'unix:///var/run/pumactl.sock'
95+
# activate_control_app 'unix:///var/run/pumactl.sock', { auth_token: '12345' }
96+
# activate_control_app 'unix:///var/run/pumactl.sock', { no_token: true }

Diff for: init/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
In this section there are provided additional configuration files for various init systems.
2+
3+
If you have something to contribute please read the [contributing guidelines](../contributing.md).

Diff for: init/systemd/README.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
## GitLab startup services for systemd (Archlinux, Fedora, etc)
2+
3+
GitLab requires a couple of services:
4+
* Web server (apache, nginx, etc.)
5+
* Redis server
6+
* Mail server (postfix or other)
7+
* GitLab Sidekiq service (`gitlab-sidekiq.service`)
8+
* Unicorn (`gitlab-unicorn.service`)
9+
10+
11+
## Setup GitLab Sidekiq service
12+
13+
Copy files to `/etc/systemd/system/`:
14+
15+
```
16+
su -
17+
cd /etc/systemd/system/
18+
wget -O gitlab-sidekiq.service https://raw.github.com/gitlabhq/gitlab-recipes/master/init/systemd/gitlab-sidekiq.service
19+
wget -O gitlab-unicorn.service https://raw.github.com/gitlabhq/gitlab-recipes/master/init/systemd/gitlab-unicorn.service
20+
wget -O gitlab.target https://raw.github.com/gitlabhq/gitlab-recipes/master/init/systemd/gitlab.target
21+
```
22+
23+
Reload systemd:
24+
25+
sudo systemctl --system daemon-reload
26+
27+
Start the services:
28+
29+
sudo systemctl start gitlab-sidekiq gitlab-unicorn
30+
31+
Enable them to start at boot:
32+
33+
sudo systemctl enable gitlab-sidekiq gitlab-unicorn
34+
35+
## Notes
36+
37+
If you installed GitLab in other path than `/home/git/gitlab` change the service files accordingly.
38+
39+
`/etc/systemd/system/` have a higher precedence over `/lib/systemd/system`.
40+
41+
For older systemd versions you need to append `service` after the service name. For example:
42+
43+
sudo systemctl start gitlab-sidekiq.service

Diff for: init/systemd/gitlab-sidekiq.service

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
###########################################################################################
2+
#
3+
# GitLab version : 5.x - 6.x
4+
# Contributors : davispuh, mtorromeo, axilleas
5+
# Downloaded from : https://github.com/gitlabhq/gitlab-recipes/tree/master/init/systemd
6+
#
7+
###########################################################################################
8+
9+
[Unit]
10+
Description=GitLab Sidekiq Worker
11+
Requires=redis.service
12+
After=syslog.target network.target redis.service
13+
Wants=mysqld.service
14+
15+
[Service]
16+
Type=forking
17+
User=git
18+
WorkingDirectory=/home/git/gitlab
19+
Environment=RAILS_ENV=production
20+
SyslogIdentifier=gitlab-sidekiq
21+
PidFile=/home/git/gitlab/tmp/pids/sidekiq.pid
22+
23+
ExecStart=/usr/bin/bundle exec rake sidekiq:start
24+
ExecStop=/usr/bin/bundle exec rake sidekiq:stop
25+
26+
[Install]
27+
WantedBy=gitlab.target

Diff for: init/systemd/gitlab-unicorn.service

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
###########################################################################################
2+
#
3+
# GitLab version : 5.x - 6.x
4+
# Contributors : davispuh, mtorromeo, axilleas
5+
# Downloaded from : https://github.com/gitlabhq/gitlab-recipes/tree/master/init/systemd
6+
#
7+
###########################################################################################
8+
9+
[Unit]
10+
Description=GitLab Unicorn Server
11+
Requires=redis.service
12+
After=network.target mysqld.service redis.service
13+
14+
[Service]
15+
User=git
16+
WorkingDirectory=/home/git/gitlab
17+
Environment=RAILS_ENV=production
18+
SyslogIdentifier=gitlab-unicorn
19+
PidFile=/home/git/gitlab/tmp/pids/unicorn.pid
20+
21+
ExecStart=/usr/bin/bundle exec "unicorn_rails -c /home/git/gitlab/config/unicorn.rb -E production"
22+
23+
[Install]
24+
WantedBy=gitlab.target

Diff for: init/systemd/gitlab.target

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
###########################################################################################
2+
#
3+
# GitLab version : 5.x - 6.x
4+
# Contributors : davispuh, mtorromeo, axilleas
5+
# Downloaded from : https://github.com/gitlabhq/gitlab-recipes/tree/master/init/systemd
6+
#
7+
###########################################################################################
8+
9+
[Unit]
10+
Description=GitLab - Self Hosted Git Management
11+
12+
[Install]
13+
WantedBy=multi-user.target
File renamed without changes.

0 commit comments

Comments
 (0)