Skip to content
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

Have the backup path configurable #25

Merged
merged 6 commits into from
Jan 11, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ 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

Usage
=====

Expand Down
3 changes: 3 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,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
12 changes: 11 additions & 1 deletion recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,20 @@
: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

# Create the backup directory
directory node['gitlab']['backup_path'] do
owner node['gitlab']['user']
group node['gitlab']['group']
mode 00755
action :create
end

# Link sqlite example config file to database.yml
link "#{node['gitlab']['app_home']}/config/database.yml" do
to "#{node['gitlab']['app_home']}/config/database.yml.sqlite"
Expand Down
4 changes: 2 additions & 2 deletions templates/default/gitlab.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down