This cookbook will deploy gitlab; a free project and repository management application.
Gitlab code is hosted here.
Going forward, the cookbook major version (i.e. 6.1.x) will target the matching stable branch (i.e. 6-1-stable) of the Gitlab application. The 6.1.x release is not backwards compatible with previous versions targeting Gitlab master.
For the 7.7.x release of the cookbook, the default Ruby will be 2.1.2 compiled with ruby_build. Using a compiled Ruby follows the Gitlab installation guidelines upstream. If you have a better approach which reduced complexity or reduces converge time, please open a pull request on Github.
The application home is located in /srv/git/gitlab
in accordance with the Filesystem Hierarchy Standard (FHS) version 2.3.
============
Hard disk space
You need to add mysql::server
or postgresql::server
to your run_list
if you intend to run the whole application stack on a single instance.
The gitlab::mysql
and gitlab::postgresql
recipes set up the RDBMS
connection only, to allow for multi-instance architecture. See
Database Attributes
documentation below for RDBMS connection
parameters.
============
Opscode, Inc cookbooks
gitlab['user']
& gitlab['group']
git
gitlab['home']
/srv/git
gitlab['app_home']
/srv/git/gitlab
gitlab['email_from']
gitlab@ + node.fqdn
gitlab['git_url']
gitlab['git_branch']
gitlab['packages']
gitlab['trust_local_sshkeys']
ssh_config
key for gitlab to trust localhost keys automatically, default yesgitlab['install_ruby']
gitlab['packages']
array.gitlab['https']
gitlab['self_signed_cert']
gitlab['certificate_databag_id']
gitlab['backup_path']
gitlab['app_home'] + backups/
gitlab['backup_keep_time']
gitlab['listen_ip']
*
(listen on all IPs)gitlab['listen_port']
gitlab['web_fqdn']
hostname -f
is not the same as the customer facing hostname.
Default is unset. Effective default is node['fqdn']gitlab['nginx_server_names']
server_name
matches. Helpful to override default test site pages
shipping with some nginx packages. Default [ 'gitlab.*', node['fqdn'] ]
.
See nginx server_name documentation
for valid matching patterns.gitlab['unicorn']['timeout']
gitlab['shell']['gitlab_host']
gitalb['web_fqdn']
or node['fqdn']
)Note, This attributes are useful when you want only admins to create projects and groups. And to restrict username changing.
gitlab['default_can_create_group']
can_create_group
profile setting.gitlab['username_changing_enabled']
Note, most of the database attributes have sane defaults. You will only need to change these configuration options if
you're using a non-standard installation. Please see attributes/default.rb
for more information on how a dynamic attribute
is calculated.
gitlab['database']['type']
gitlab['database']['adapter']
type
)gitlab['database']['socket']
gitlab['database']['encoding']
type
)gitlab['database']['host']
127.0.0.1
gitlab['database']['userhost']
127.0.0.1
gitlab['database']['pool']
gitlab['database']['database']
gitlab
gitlab['database']['username']
gitlab
gitlab'['ldap']['enabled']
gitlab['ldap']['host']
gitlab['ldap']['base']
gitlab['ldap']['port']
gitlab['ldap']['uid']
gitlab['ldap']['method']
gitlab['ldap']['bind_dn']
gitlab['ldap']['password']
gitlab['ldap']['allow_username_or_email_login']
gitlab['ldap']['user_filter']
This installs and starts GitLab with nginx and your chosen database.
These are internal, set gitlab['database']['type']
instead.
Optionally override application paths using gitlab['git_home'] and gitlab['home'].
Add recipe gitlab::default to run_list. Go grab a lunch, or two, if Ruby has to build.
The default admin credentials for the gitlab application are as follows:
User: admin@local.host
Password: 5iveL!fe
Of course you should change these first thing, once deployed.
name "gitlab_https"
description "Configures and installs gitlab w/ https, and mysql server"
override_attributes "gitlab" => {
"https" => true,
"certificate_databag_id" => "wildcard"
}
run_list "recipe[gitlab]"
As of now it's not supported in the cookbook out of the box, however following steps document this process.
To upgrade Gitlab version make sure you:
override['gitlab']['git_branch'] = '8-0-stable'
override['gitlab']['shell']['git_branch'] = 'v2.6.5'
override['languages']['ruby']['default_version'] = '2.1.6'
You may skip merging all configuration files, init.d scripts etc.
In general this procedure consist of following steps:
sudo service gitlab stop
sudo su - git
cd /srv/git/gitlab
# bundle install
bundle exec rake gitlab:backup:create RAILS_ENV=production
git fetch --all
git checkout -- db/schema.rb # local changes will be restored automatically
git checkout 8-0-stable
cd /srv/git/gitlab-shell
git fetch
git checkout v2.6.5
# for 8x somewhere here should gitlab cookbook generate new configuration files
# MySQL installations
bundle install --without postgres development test --deployment
# PostgreSQL installations
bundle install --without mysql development test --deployment
bundle exec rake db:migrate RAILS_ENV=production
bundle exec rake assets:clean assets:precompile cache:clear RAILS_ENV=production
sudo service gitlab start
sudo service nginx restart
NOTE: Don't forget to make trusted backups first!
Author: Gerald L. Hevener Jr., M.S. Copyright: 2012
Author: Eric G. Wolfe Copyright: 2012
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.