summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2015-10-26 10:40:13 +0000
committerRobert Speicher <robert@gitlab.com>2015-10-26 10:40:13 +0000
commitbf30332ea8adf067b8c9aaad3b934749b7e6f71e (patch)
treefc1ab303e53e20c0d07be03078f4cce858b56d00
parentf66ec1bc8157e5481ba23660b226267293c85129 (diff)
parent122f02bc39c690b7fef69f57075380ca82c25b46 (diff)
downloadgitlab-ce-bf30332ea8adf067b8c9aaad3b934749b7e6f71e.tar.gz
Merge branch 'remove-satellites' into 'master'
Add migration to remove the contents of the satellites dir See merge request !1681
-rw-r--r--config/gitlab.yml.example6
-rw-r--r--config/initializers/1_settings.rb4
-rw-r--r--db/migrate/20151023144219_remove_satellites.rb17
-rw-r--r--db/schema.rb2
4 files changed, 25 insertions, 4 deletions
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
index 8b85981497a..d3aef44705b 100644
--- a/config/gitlab.yml.example
+++ b/config/gitlab.yml.example
@@ -318,10 +318,12 @@ production: &base
# ==========================
# GitLab Satellites
+ #
+ # Note for maintainers: keep the satellites.path setting until GitLab 9.0 at
+ # least. This setting is fed to 'rm -rf' in
+ # db/migrate/20151023144219_remove_satellites.rb
satellites:
- # Relative paths are relative to Rails.root (default: tmp/repo_satellites/)
path: /home/git/gitlab-satellites/
- timeout: 30
## Backup settings
backup:
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index d5493ca038d..65e9b0dcb50 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -242,9 +242,11 @@ Settings.git['max_size'] ||= 20971520 # 20.megabytes
Settings.git['bin_path'] ||= '/usr/bin/git'
Settings.git['timeout'] ||= 10
+# Important: keep the satellites.path setting until GitLab 9.0 at
+# least. This setting is fed to 'rm -rf' in
+# db/migrate/20151023144219_remove_satellites.rb
Settings['satellites'] ||= Settingslogic.new({})
Settings.satellites['path'] = File.expand_path(Settings.satellites['path'] || "tmp/repo_satellites/", Rails.root)
-Settings.satellites['timeout'] ||= 30
#
# Extra customization
diff --git a/db/migrate/20151023144219_remove_satellites.rb b/db/migrate/20151023144219_remove_satellites.rb
new file mode 100644
index 00000000000..e73f300028a
--- /dev/null
+++ b/db/migrate/20151023144219_remove_satellites.rb
@@ -0,0 +1,17 @@
+require 'fileutils'
+
+class RemoveSatellites < ActiveRecord::Migration
+ def up
+ satellites = Gitlab.config['satellites']
+ return if satellites.nil?
+
+ satellites_path = satellites['path']
+ return if satellites_path.nil?
+
+ FileUtils.rm_rf(satellites_path)
+ end
+
+ def down
+ # Do nothing
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 1551956c8bc..0fe113325fa 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20151023112551) do
+ActiveRecord::Schema.define(version: 20151023144219) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"