Remove the contents of the satellites dir

This commit is contained in:
Jacob Vosmaer 2015-10-23 16:51:44 +02:00
parent 0bb50ea081
commit 122f02bc39
4 changed files with 25 additions and 4 deletions

View file

@ -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:

View file

@ -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

View file

@ -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

View file

@ -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"