Skip to content

Commit 793f043

Browse files
committed
Update readme with new recipe structure
1 parent 31cc96f commit 793f043

File tree

1 file changed

+54
-43
lines changed

1 file changed

+54
-43
lines changed

README.md

Lines changed: 54 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,46 @@
22

33
Chef cookbook to setup gitlab v5.2 according to [these instructions](https://github.com/gitlabhq/gitlabhq/blob/v5.2.0/doc/install/installation.md).
44

5-
# Requirements
5+
## Requirements
66

7-
To develop and test this cookbook, we recommend installing [Vagrant](http://www.vagrantup.com/) and [vagrant-berkshelf](https://github.com/RiotGames/vagrant-berkshelf).
7+
To contribute to and test this cookbook, we recommend installing [Vagrant](http://www.vagrantup.com/) and [vagrant-berkshelf](https://github.com/RiotGames/vagrant-berkshelf).
88

9-
#### Platforms
9+
### Supported Platforms
1010
* Ubuntu 12.04
1111
* CentOS 6.4
1212

13-
# Usage
13+
## Attributes
1414

15-
## gitlab::default
15+
It is recommended that you change the following attributes:
16+
17+
* `node['gitlab']['root']['name']` - Name of the root user. (default: 'Administrator')
18+
* `node['gitlab']['root']['email']` - Email of the root user. (default: '[email protected]')
19+
* `node['gitlab']['root']['username']` - Username of the root user. (default: 'root')
20+
* `node['gitlab']['root']['password']` - Password of the root user. (default: '5iveL!fe')
21+
22+
Set these attributes to match your server configuration:
23+
24+
* `node['gitlab']['url']` - Url to the gitlab instance. Used for api calls (default: 'http://localhost/')
25+
* `node['gitlab']['host']` - Host name in gitlab.yml (default: 'localhost')
26+
* `node['gitlab']['email_from']` - Email address used in the "From" field in mails sent by GitLab (default: 'gitlab@localhost')
27+
* `node['gitlab']['support_email']` - Email address of your support contact (default: 'support@localhost')
28+
29+
See the `attributes/default.rb` file for the full list of attributes.
30+
31+
## Usage
32+
33+
Installing Ruby and configuring Nginx are now separated from the default recipe. This allows users to choose their prefered ruby installation and to use apache instead of nginx. (If you do use apache, please consider writing a recipe and opening a pull request).
1634

17-
Default recipe. Installs Gitlab with all its dependencies. Configures it as a service that is started at boot time.
35+
There are three recipes in this cookbook to help you install ruby:
36+
37+
* `gitlab::ruby_package`: Install ruby through the OS package manager. Uses the `node['ruby_package']['version']` attribute. (Recommended for new user)
38+
* `gitlab::ruby_build`: Compile ruby from source with [ruby_build](https://github.com/sstephenson/ruby-build). Uses the `node['ruby_build']['version']` attribute. (For advanced users)
39+
* `gitlab::ruby_rvm`: Compile ruby via [rvm](https://rvm.io/). This recipe is a little less stable than the previous two recipes. Please open an issue or pull request if you encounter problems. Uses the `node['rvm']['default_ruby']` attribute.
40+
41+
42+
### gitlab::default
43+
44+
Default recipe. Installs Gitlab and its dependencies. Configures it as a service that is started at boot time.
1845

1946
Add `gitlab::default` to your node's run_list and make sure to set these attributes:
2047

@@ -40,19 +67,23 @@ Add `gitlab::default` to your node's run_list and make sure to set these attribu
4067
}
4168
```
4269

43-
When running on CentOS, you also have to provide the following RVM configuration:
70+
Make sure your node has ruby 1.9.3 installed. (eg: by using the `gitlab::ruby_package` recipe). You can optionally add the `gitlab::nginx`.
4471

4572
```json
46-
"rvm" : {
47-
"default_ruby" : "1.9.3",
48-
"global_gems" : [
49-
{"name" : "bundler"},
50-
{"name" : "chef"}
73+
{
74+
"run_list": [
75+
"recipe[gitlab::ruby_package]",
76+
"recipe[gitlab::default]",
77+
"recipe[gitlab::nginx]"
5178
]
5279
}
5380
```
5481

55-
## With Vagrant from an other repository
82+
See the [Vagrantfile](https://github.com/andruby/gitlab-cookbook/blob/master/Vagrantfile) for a full example.
83+
84+
### gitlab::development
85+
86+
Recipe to set up most development requirements.
5687

5788
When I work on the GitlabHQ code I use this Vagrantfile (inside the GitlabHQ code directory):
5889

@@ -66,8 +97,8 @@ Vagrant.configure("2") do |config|
6697
config.vm.hostname = "gitlab-dev"
6798

6899
# Standard Ubuntu 12.04.2 base box
69-
config.vm.box = "ubuntu-12.04.2-amd64"
70-
config.vm.box_url = "https://dl.dropbox.com/u/2894322/ubuntu-12.04.2-amd64.box"
100+
config.vm.box = "ubuntu-12.04.2-amd64-chef-11-omnibus"
101+
config.vm.box_url = "http://grahamc.com/vagrant/ubuntu-12.04-omnibus-chef.box"
71102

72103
# Create a forwarded port mapping which allows access to a specific port
73104
# within the machine from a port on the host machine. In the example below,
@@ -76,6 +107,7 @@ Vagrant.configure("2") do |config|
76107
config.vm.network :forwarded_port, guest: 3000, host: 3001 # Development Puma
77108

78109
config.vm.provision :chef_solo do |chef|
110+
chef.log_level = :debug
79111
chef.json = {
80112
:mysql => {
81113
:server_root_password => 'rootpass',
@@ -84,46 +116,25 @@ Vagrant.configure("2") do |config|
84116
:bind_address => 'localhost'
85117
},
86118
:gitlab => {
87-
:mysql_password => 'k09vw7wa5s',
88-
:path => '/vagrant',
89-
:rails_env => 'development',
90-
:sync_repository => false,
91-
:bundle_install_cmd => 'bundle install --without postgres'
119+
:mysql_password => 'gitlabpass'
92120
}
93121
}
94122

95-
chef.add_recipe "gitlab::default"
123+
chef.add_recipe "gitlab::ruby_build"
124+
chef.add_recipe "gitlab::development"
96125
end
97126
end
98127
```
99128

100-
Note the `path`, `sync_repository`, `rails_env` and `bundle_install_cmd` used to set gitlab in development mode.
101-
102-
With this Berksfile
129+
With this Berksfile:
103130

104-
```
131+
```ruby
105132
cookbook 'gitlab', :git => 'https://github.com/andruby/gitlab-cookbook.git'
106133
```
107134

108-
# Attributes
109-
110-
It is recommended that you change the following attributes:
111-
112-
* `node['gitlab']['root']['name']` - Name of the root user. (default: 'Administrator')
113-
* `node['gitlab']['root']['email']` - Email of the root user. (default: '[email protected]')
114-
* `node['gitlab']['root']['username']` - Username of the root user. (default: 'root')
115-
* `node['gitlab']['root']['password']` - Password of the root user. (default: '5iveL!fe')
116-
117-
Set these attributes to match your server configuration:
118-
119-
* `node['gitlab']['url']` - Url to the gitlab instance. Used for api calls (default: 'http://localhost/')
120-
* `node['gitlab']['host']` - Host name in gitlab.yml (default: 'localhost')
121-
* `node['gitlab']['email_from']` - Email address used in the "From" field in mails sent by GitLab (default: 'gitlab@localhost')
122-
* `node['gitlab']['support_email']` - Email address of your support contact (default: 'support@localhost')
123-
124-
See the `attributes/default.rb` file for the full list of attributes.
135+
When your VM is up and provisioned you should run `bundle install --without postgres` and `rake gitlab:setup` inside the VM in the `/vagrant` directory.
125136

126-
# Authors
137+
## Authors
127138

128139
* [Andrew Fecheyr](https://github.com/andruby) (<[email protected]>)
129140
* [Aimo Thiele](https://github.com/athiele) (<[email protected]>)

0 commit comments

Comments
 (0)