Permalink
Browse files

Merge branch 'configurable_backup_path' of git://github.com/dscheu/co…

…okbook-gitlab into dscheu-configurable_backup_path

Conflicts:
	README.md
	recipes/default.rb
  • Loading branch information...
2 parents c30ee62 + 1834601 commit cb5a5482243bba74e0b1596238826c97ad4b83db Eric G. Wolfe committed Jan 11, 2013
Showing with 33 additions and 13 deletions.
  1. +16 −10 README.md
  2. +3 −0 attributes/default.rb
  3. +12 −1 recipes/default.rb
  4. +2 −2 templates/default/gitlab.yml.erb
View
@@ -1,7 +1,6 @@
# <a name="title"></a> cookbook-gitlab [![Build Status](https://secure.travis-ci.org/atomic-penguin/cookbook-gitlab.png?branch=master)](http://travis-ci.org/atomic-penguin/cookbook-gitlab)
-Description
-===========
+## Description
This cookbook will deploy gitlab; a free project and repository management
application.
@@ -11,7 +10,7 @@ Code hosted on github [here](https://github.com/gitlabhq/gitlabhq/tree/stable).
This cookbook was developed on RHEL/CentOS 6. Other platforms may need re-worked,
please open an issue or send a pull request to either, atomic-penguin or jackl0phty, on github.
-Requirements
+## Requirements
============
* Hard disk space
@@ -23,8 +22,7 @@ Requirements
* Nginx package
- All platforms need an nginx package to configure Nginx and Unicorn.
-Cookbooks + Acknowledgements
-----------------------------
+## Cookbooks + Acknowledgements
The dependencies in this cookbook add up to over 1,500 lines of code.
This would not have been possible without the great community work of so many others.
@@ -63,8 +61,7 @@ Much kudos to everyone who added indirectly to the epicness of this cookbook.
- [zlib](http://ckbk.it/zlib)
-Notes about conflicts
----------------------
+## Notes about conflicts
* [gitolite](http://ckbk.it/gitolite) cookbook
- The gitolite recipe within our cookbook was based on David Ruan's cookbook.
@@ -77,8 +74,7 @@ Notes about conflicts
- Our default recipe templates out the /etc/nginx/conf.d/default.conf. This will directly
conflict with another cookbook, such as nginx, trying to manage this file.
-Attributes
-==========
+## Attributes
* gitlab['gitolite\_url']
- Github gitolite address
@@ -144,9 +140,19 @@ Attributes
* gitlab['ssl\_req']
- Request subject used to generate a self-signed SSL certificate
+* gitlab['backup\_path']
+ - Path in file system where backups are stored.
+ - Defaults to gitlab['app\_home'] + backups/
+
+* gitlab['backup\_keep\_time']
+ - In seconds. Older backups will automatically be deleted when new backup is created. Set to 0 to keep backups forever.
+ - Defaults to 604800
### Database Attributes
-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.
+
+**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']
- The database (datastore) to use.
View
@@ -84,3 +84,6 @@
default['gitlab']['ssl_certificate'] = "/etc/nginx/#{node['fqdn']}.crt"
default['gitlab']['ssl_certificate_key'] = "/etc/nginx/#{node['fqdn']}.key"
default['gitlab']['ssl_req'] = "/C=US/ST=Several/L=Locality/O=Example/OU=Operations/CN=#{node['fqdn']}/emailAddress=root@localhost"
+
+default['gitlab']['backup_path'] = node['gitlab']['app_home'] + "/backups"
+default['gitlab']['backup_keep_time'] = 604800
View
@@ -200,7 +200,9 @@
:fqdn => node['fqdn'],
:https_boolean => node['gitlab']['https'],
:git_user => node['gitlab']['git_user'],
- :git_home => node['gitlab']['git_home']
+ :git_home => node['gitlab']['git_home'],
+ :backup_path => node['gitlab']['backup_path'],
+ :backup_keep_time => node['gitlab']['backup_keep_time']
)
end
@@ -214,6 +216,14 @@
Chef::Log.error "#{node['gitlab']['database']['type']} is not a valid type. Please use 'mysql' or 'postgres'!"
end
+# Create the backup directory
+directory node['gitlab']['backup_path'] do
+ owner node['gitlab']['user']
+ group node['gitlab']['group']
+ mode 00755
+ action :create
+end
+
# Write the database.yml
template "#{node['gitlab']['app_home']}/config/database.yml" do
source 'database.yml.erb'
@@ -232,6 +242,7 @@
end
without_group = node['gitlab']['database'] == 'mysql' ? 'postgres' : 'mysql'
+
# Install Gems with bundle install
execute "gitlab-bundle-install" do
command "bundle install --without development test #{without_group} --deployment"
@@ -23,8 +23,8 @@ email:
# Like default project limit for user etc
app:
default_projects_limit: 10
- # backup_path: "/vol/backups" # default: Rails.root + backups/
- # backup_keep_time: 604800 # default: 0 (forever) (in seconds)
+ backup_path: "<%= @backup_path %>"
+ backup_keep_time: <%= @backup_keep_time %>
# Git Hosting congiguration
git_host:

0 comments on commit cb5a548

Please sign in to comment.