BigW Consortium Gitlab

setup_builds_storage.rb 436 Bytes
Newer Older
1 2
RSpec.configure do |config|
  def builds_path
Kamil Trzcinski committed
3
    Rails.root.join('tmp/builds')
4 5 6 7
  end

  config.before(:each) do
    FileUtils.mkdir_p(builds_path)
Kamil Trzcinski committed
8
    FileUtils.touch(File.join(builds_path, ".gitkeep"))
9
    Settings.gitlab_ci['builds_path'] = builds_path
10 11 12
  end

  config.after(:suite) do
13 14 15 16
    Dir[File.join(builds_path, '*')].each do |path|
      next if File.basename(path) == '.gitkeep'

      FileUtils.rm_rf(path)
17 18 19
    end
  end
end