Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Have the backup path configurable #25

Merged
merged 6 commits into from

2 participants

@dscheu

In order to be able to use the rake tasks gitlab provides to create and restore backups, it would be nice to have the backup_path and backup_keep_time settings of gitlab.yml configurable.

@atomic-penguin atomic-penguin merged commit 1834601 into atomic-penguin:master

1 check passed

Details default The Travis build passed
@atomic-penguin atomic-penguin referenced this pull request from a commit
@atomic-penguin Issues #19 #25 #26
Release target, Gitlab CB v0.5.0

* Database back-end changes via @sethvargo
  - Adds a mysql and postgresql database creation
  - **Breaking change**: developed against githlabhq/master (sqlite no longer supported)

* Gitolite deploy changes via @dscheu
  - Deploy gitlabhq/gitolite, not sitaramc/gitolite

* Add configurable backup paths to Gitlab configuration via @dscheu
ed4cc27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 17, 2012
  1. Create the backup directory

    dscheu authored
Commits on Dec 19, 2012
Commits on Dec 20, 2012
  1. Create the backup directory

    dscheu authored
This page is out of date. Refresh to see the latest.
View
8 README.md
@@ -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
=====
View
3  attributes/default.rb
@@ -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
View
12 recipes/default.rb
@@ -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"
View
4 templates/default/gitlab.yml.erb
@@ -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:
Something went wrong with that request. Please try again.