Skip to content

[WIP] New repository structure #111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 42 commits into from
Aug 22, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
75bcb79
Initial commit of new structure
axilleas Jul 31, 2013
50e3129
Add initial readme for Gentoo/Archlinux
axilleas Jul 31, 2013
86f65b5
Update general readme with instructions on Pull Requests
axilleas Aug 1, 2013
e6f6f31
Add readme for install guidelines
axilleas Aug 1, 2013
f9bf3d1
Better wording
axilleas Aug 1, 2013
a918217
Add opensuse
axilleas Aug 2, 2013
91eafbb
Fix table
axilleas Aug 2, 2013
25e7fd2
Replace maintainer with contributor, add init in example
axilleas Aug 2, 2013
d38bd03
Clean up readme
axilleas Aug 2, 2013
c139f0e
Add dummy readme files
axilleas Aug 2, 2013
2e80483
Refine install guidelines
axilleas Aug 4, 2013
a480d06
Add database info
axilleas Aug 4, 2013
04eb186
Add alternative CentOS nginx setup. Implement #31
axilleas Aug 5, 2013
fabeb6a
Enhance existing apache config. Implement #50 and #79
axilleas Aug 5, 2013
2afea0d
Refine nginx config for ssl connections. Implements #67 and #92
axilleas Aug 5, 2013
be95bd4
Enhance existing apache config. Implement #50, #79, #93. Fix #10
axilleas Aug 5, 2013
7e3bdeb
Refine nginx config for ssl connections. Implements #67 and #92
axilleas Aug 5, 2013
21bfab7
Merge branch 'test' into new_structure
axilleas Aug 5, 2013
9eabc93
Implement #58 #96 #99
axilleas Aug 5, 2013
c8cd324
New init url. Fix #109
axilleas Aug 5, 2013
2b552fb
First rewrite attempt of CentOS guide
axilleas Aug 9, 2013
433fac4
Move guidelines to main README, add info for epel repo in CentOS guide
axilleas Aug 17, 2013
9d4aaa9
Cleanup guide, add instructions of git update. Implement #102, Fix #62
axilleas Aug 17, 2013
8856901
Rewrite info about nginx on CentOS
axilleas Aug 18, 2013
d874d1c
Add sysvinit configs for puma and unicorn
axilleas Aug 18, 2013
9833fc5
Use unicorn by default. Add info for puma use, implement #87
axilleas Aug 18, 2013
9b750ab
Finish CentOS installation guide
axilleas Aug 18, 2013
a474bb1
Minor fixes
axilleas Aug 18, 2013
2f555a5
Fix code block
axilleas Aug 18, 2013
471ee56
Add first draft of systemd services. Fix #14 Implement #43
axilleas Aug 18, 2013
a334104
Add SELinux link
axilleas Aug 19, 2013
fcd87ac
Add puma relevant files
axilleas Aug 19, 2013
5581ab8
Fix readme
axilleas Aug 20, 2013
2c31ba6
Split line
axilleas Aug 20, 2013
3eee346
Move contributing guidelines to separate file
axilleas Aug 20, 2013
44eee6b
Use plural
axilleas Aug 20, 2013
6881f2b
Add contributors info, reference download links
axilleas Aug 20, 2013
b96f664
Move puma to own namespace
axilleas Aug 20, 2013
1a480d6
Add README file in each main dir
axilleas Aug 20, 2013
a80428e
Uppercase
axilleas Aug 21, 2013
9a7bcd8
Add newline to quote
axilleas Aug 22, 2013
b614352
Fix the link pointing to CONTRIBUTING.md
axilleas Aug 22, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Contribute to GitLab recipes

This guide details how to use issues and pull requests to improve GitLab recipes.

Please stick as close as possible to the guidelines. That way we ensure quality guides
and easy to merge requests.

Your Pull Request will be reviewed by one of our devs/volunteers and you will be
asked to reformat it if needed. We don't bite and we will try to be as flexible
as possible, so don't get intimidated by the extent of the quidelines :)

For better maintainance and clarity, some naming guidelines should be followed.
See details in each section below.

## Pull Request title

Try to be as more descriptive as you can in your Pull Request title.

Particularly if you are submitting a new script or guide, include in the title,
information about GitLab version, OS tested on and any other relevant info.

For example some good titles would be:

* [Installation script] GitLab 6.x - Ubuntu 12.04 - Apache
* [Guide] GitLab 6.1 - FreeBSD - postrges, rvm

## Guides

Each installation guide has its own namespace and it should be provided in a
`README` file so that it renders first when viewing the repository. Submit a new
one in `install/platform/README.md` (it doesn't have to be strictly in markdown though).

## Scripts

Installation scripts reside in `install/platform/scripts/`, so if you have one,
submit it there. They should named after the following scheme: `platform-platform_version`.

Example: `ubuntu-server-12.04.sh`

You are strongly encouraged to also provide a `README` file that describes
how to use the script. You may have included all the needed info in the script
itself (recommended), so you could simply write something between the lines:

> This script installs GitLab 6.0 on Archlinux. Run it with `./archlinux.sh your_domain_name`
>
> For more info and variables you can change, read the comments in the script.


### Scripts doing similar things

There is a strong possibility that your script will do similar things to what a
script already in this repo do. In that case, please work on the existing script
and enhance it with your changes. No need to duplicate things.

## What information to put on your guide/script etc (mandatory)

If you have an installation guide to provide, fill in the template and place it on top
of it or include it in your installation script (commented), again on top. Try to
include as many items of this template as you can.

### Template

```
Distribution :
GitLab version :
Web Server :
Init system :
Database :
Contributors :
Additional Notes :
```

### Explanation

| Label | Explanation |
| ---------------- | ------------------------- |
| Distribution | The official name and version of the platform/distribution, case sensitive. |
| GitLab version | GitLab version on which the guide/script was tested. |
| Web Server | The web server used to serve GitLab. May be two-fold, eg. apache with mod_passenger. |
| Init system | (Optional but recommended) The init system used by the platform if any. Examples: `sysvinit`, `systemd`, `upstart`, `openrc`, etc |
| Database | The database used for installation. Examples: `mysql`, `postrgres`, `mariadb`.
| 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)** |
| 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.|


### Example

```
Distribution : Fedora 19
GitLab version : 5.4
Web Server : apache with mod_passenger
Init system : systemd
Database : mariadb
Contributors : thedude
Additional Notes : the script uses rvm to install ruby
```
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
gitlab-recipes
==============
## GitLab recipes: unofficial guides for using GitLab with different software

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

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

# GITLAB
# Maintainer: @randx
# App Version: 5.0
## Contributing

See [contributing.md](CONTRIBUTING.md) for contribution guidelines.

## Notes on the reliability of guides/scripts

* We will try to test everything before accepting PRs, in a clean, newly installed platform.
* You should read a script and understand what it does prior to running it.
* If something goes wrong during installation and you think the guide/script needs fixing, file a bug report or a submit a Pull Request.
36 changes: 0 additions & 36 deletions apache/gitlab

This file was deleted.

3 changes: 3 additions & 0 deletions app-server/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
In this section there are provided additional configuration files for various application servers.

If you have something to contribute please read the [contributing guidelines](../contributing.md).
1 change: 1 addition & 0 deletions app-server/puma/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Alternative configuration file for the `puma` application server. Copy it under `/home/git/gitlab/config/`.
96 changes: 96 additions & 0 deletions app-server/puma/puma.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#!/usr/bin/env puma

# Start Puma with next command:
# RAILS_ENV=production bundle exec puma -C ./config/puma.rb

# uncomment and customize to run in non-root path
# note that config/gitlab.yml web path should also be changed
# ENV['RAILS_RELATIVE_URL_ROOT'] = "/gitlab"

application_path = '/home/git/gitlab'
directory application_path
environment 'production'
daemonize true
pidfile "#{application_path}/tmp/pids/puma.pid"
state_path "#{application_path}/tmp/pids/puma.state"
stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log"

# Configure “min” to be the minimum number of threads to use to answer
# requests and “max” the maximum.
#
# The default is “0, 16”.
#
# threads 0, 16

# Bind the server to “url”. “tcp://”, “unix://” and “ssl://” are the only
# accepted protocols.
#
#
# The default is “tcp://0.0.0.0:9292”.
#
# bind 'tcp://0.0.0.0:9292'
# bind 'unix:///var/run/puma.sock'
# bind 'unix:///var/run/puma.sock?umask=0777'
# bind 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert'
#
## Comment the next line if you use apache.
bind "unix://#{application_path}/tmp/sockets/gitlab.socket"

# Instead of “bind 'ssl://127.0.0.1:9292?key=path_to_key&cert=path_to_cert'” you
# can also use the “ssl_bind” option.
#
# ssl_bind '127.0.0.1', '9292', { key: path_to_key, cert: path_to_cert }

# Code to run before doing a restart. This code should
# close log files, database connections, etc.
#
# This can be called multiple times to add code each time.
#
# on_restart do
# puts 'On restart...'
# end

# Command to use to restart puma. This should be just how to
# load puma itself (ie. 'ruby -Ilib bin/puma'), not the arguments
# to puma, as those are the same as the original process.
#
# restart_command '/u/app/lolcat/bin/restart_puma'

# === Cluster mode ===

# How many worker processes to run.
#
# The default is “0”.
#
# workers 2

# GitLab cluster mode recommendations
# If you have more than 1 GB RAM, uncomment one of the following lines:
#
# workers 2 # if you have at least 1.5 GB RAM
# workers 3 # if you have at least 2 GB RAM
# workers 4 # if you have at least 2.5 GB RAM

# Code to run when a worker boots to setup the process before booting
# the app.
#
# This can be called multiple times to add hooks.
#
# on_worker_boot do
# puts 'On worker boot...'
# end

# === Puma control rack application ===

# Start the puma control rack application on “url”. This application can
# be communicated with to control the main server. Additionally, you can
# provide an authentication token, so all requests to the control server
# will need to include that token as a query parameter. This allows for
# simple authentication.
#
# Check out https://github.com/puma/puma/blob/master/lib/puma/app/status.rb
# to see what the app has available.
#
# activate_control_app 'unix:///var/run/pumactl.sock'
# activate_control_app 'unix:///var/run/pumactl.sock', { auth_token: '12345' }
# activate_control_app 'unix:///var/run/pumactl.sock', { no_token: true }
3 changes: 3 additions & 0 deletions init/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
In this section there are provided additional configuration files for various init systems.

If you have something to contribute please read the [contributing guidelines](../contributing.md).
43 changes: 43 additions & 0 deletions init/systemd/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## GitLab startup services for systemd (Archlinux, Fedora, etc)

GitLab requires a couple of services:
* Web server (apache, nginx, etc.)
* Redis server
* Mail server (postfix or other)
* GitLab Sidekiq service (`gitlab-sidekiq.service`)
* Unicorn (`gitlab-unicorn.service`)


## Setup GitLab Sidekiq service

Copy files to `/etc/systemd/system/`:

```
su -
cd /etc/systemd/system/
wget -O gitlab-sidekiq.service https://raw.github.com/gitlabhq/gitlab-recipes/master/init/systemd/gitlab-sidekiq.service
wget -O gitlab-unicorn.service https://raw.github.com/gitlabhq/gitlab-recipes/master/init/systemd/gitlab-unicorn.service
wget -O gitlab.target https://raw.github.com/gitlabhq/gitlab-recipes/master/init/systemd/gitlab.target
```

Reload systemd:

sudo systemctl --system daemon-reload

Start the services:

sudo systemctl start gitlab-sidekiq gitlab-unicorn

Enable them to start at boot:

sudo systemctl enable gitlab-sidekiq gitlab-unicorn

## Notes

If you installed GitLab in other path than `/home/git/gitlab` change the service files accordingly.

`/etc/systemd/system/` have a higher precedence over `/lib/systemd/system`.

For older systemd versions you need to append `service` after the service name. For example:

sudo systemctl start gitlab-sidekiq.service
27 changes: 27 additions & 0 deletions init/systemd/gitlab-sidekiq.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
###########################################################################################
#
# GitLab version : 5.x - 6.x
# Contributors : davispuh, mtorromeo, axilleas
# Downloaded from : https://github.com/gitlabhq/gitlab-recipes/tree/master/init/systemd
#
###########################################################################################

[Unit]
Description=GitLab Sidekiq Worker
Requires=redis.service
After=syslog.target network.target redis.service
Wants=mysqld.service

[Service]
Type=forking
User=git
WorkingDirectory=/home/git/gitlab
Environment=RAILS_ENV=production
SyslogIdentifier=gitlab-sidekiq
PidFile=/home/git/gitlab/tmp/pids/sidekiq.pid

ExecStart=/usr/bin/bundle exec rake sidekiq:start
ExecStop=/usr/bin/bundle exec rake sidekiq:stop

[Install]
WantedBy=gitlab.target
24 changes: 24 additions & 0 deletions init/systemd/gitlab-unicorn.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
###########################################################################################
#
# GitLab version : 5.x - 6.x
# Contributors : davispuh, mtorromeo, axilleas
# Downloaded from : https://github.com/gitlabhq/gitlab-recipes/tree/master/init/systemd
#
###########################################################################################

[Unit]
Description=GitLab Unicorn Server
Requires=redis.service
After=network.target mysqld.service redis.service

[Service]
User=git
WorkingDirectory=/home/git/gitlab
Environment=RAILS_ENV=production
SyslogIdentifier=gitlab-unicorn
PidFile=/home/git/gitlab/tmp/pids/unicorn.pid

ExecStart=/usr/bin/bundle exec "unicorn_rails -c /home/git/gitlab/config/unicorn.rb -E production"

[Install]
WantedBy=gitlab.target
13 changes: 13 additions & 0 deletions init/systemd/gitlab.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
###########################################################################################
#
# GitLab version : 5.x - 6.x
# Contributors : davispuh, mtorromeo, axilleas
# Downloaded from : https://github.com/gitlabhq/gitlab-recipes/tree/master/init/systemd
#
###########################################################################################

[Unit]
Description=GitLab - Self Hosted Git Management

[Install]
WantedBy=multi-user.target
File renamed without changes.
Loading