Commit eea8a6d0 authored by Robert Speicher's avatar Robert Speicher Committed by Robert Speicher

Merge branch 'remove-satellites' into 'master'

Add migration to remove the contents of the satellites dir

See merge request !1681
parent 21854582
...@@ -318,10 +318,12 @@ production: &base ...@@ -318,10 +318,12 @@ production: &base
# ========================== # ==========================
# GitLab Satellites # 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: satellites:
# Relative paths are relative to Rails.root (default: tmp/repo_satellites/)
path: /home/git/gitlab-satellites/ path: /home/git/gitlab-satellites/
timeout: 30
## Backup settings ## Backup settings
backup: backup:
......
...@@ -242,9 +242,11 @@ Settings.git['max_size'] ||= 20971520 # 20.megabytes ...@@ -242,9 +242,11 @@ Settings.git['max_size'] ||= 20971520 # 20.megabytes
Settings.git['bin_path'] ||= '/usr/bin/git' Settings.git['bin_path'] ||= '/usr/bin/git'
Settings.git['timeout'] ||= 10 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'] ||= Settingslogic.new({})
Settings.satellites['path'] = File.expand_path(Settings.satellites['path'] || "tmp/repo_satellites/", Rails.root) Settings.satellites['path'] = File.expand_path(Settings.satellites['path'] || "tmp/repo_satellites/", Rails.root)
Settings.satellites['timeout'] ||= 30
# #
# Extra customization # Extra customization
......
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
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # 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 # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment