Skip to content
Snippets Groups Projects
Commit 9436dca4 authored by Kamil Trzcinski's avatar Kamil Trzcinski
Browse files

Make configurable builds_path in application.yml

parent 00b6536f
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -9,10 +9,11 @@ v7.13.0
- Redirect back after authorization
- Change favicon
- Refactoring: Get rid of private_token usage in the frontend.
- Build traces is stored in the file instead of database
- Make the builds path configurable
 
v7.12.2
- Revert: Runner without tag should pick builds without tag only
- Build traces is stored in the file instead of database
 
v7.12.1
- Runner without tag should pick builds without tag only
Loading
Loading
Loading
Loading
@@ -229,17 +229,13 @@ class Build < ActiveRecord::Base
end
 
def dir_to_trace
Rails.root.join(
root_dir_to_trace,
File.join(
Settings.gitlab_ci.builds_path,
created_at.utc.strftime("%Y_%m"),
project.id.to_s
)
end
 
def root_dir_to_trace
"builds"
end
def path_to_trace
"#{dir_to_trace}/#{id}.log"
end
Loading
Loading
Loading
Loading
@@ -29,6 +29,9 @@ defaults: &defaults
# Add pusher to recipients list (default: false)
# add_pusher: true
 
# The location where build traces are stored (default: builds/). Relative paths are relative to Rails.root
# builds_path: builds/
gravatar:
enabled: true
plain_url: "http://www.gravatar.com/avatar/%{hash}?s=%{size}&d=mm"
Loading
Loading
Loading
Loading
@@ -40,6 +40,7 @@ Settings.gitlab_ci['support_email'] ||= Settings.gitlab_ci.email_from
Settings.gitlab_ci['all_broken_builds'] = true if Settings.gitlab_ci['all_broken_builds'].nil?
Settings.gitlab_ci['add_pusher'] = false if Settings.gitlab_ci['add_pusher'].nil?
Settings.gitlab_ci['url'] ||= Settings.send(:build_gitlab_ci_url)
Settings.gitlab_ci['builds_path'] = File.expand_path(Settings.gitlab_ci['builds_path'] || "builds/", Rails.root)
 
# Compatibility with old config
Settings['gitlab_server_urls'] ||= Settings['allowed_gitlab_urls']
Loading
Loading
RSpec.configure do |config|
def builds_path
Rails.root.join('tmp/builds_test')
end
config.before(:each) do
FileUtils.mkdir_p("tmp/builds_test")
Build.any_instance.stub(:root_dir_to_trace).and_return("tmp/builds_test")
FileUtils.mkdir_p(builds_path)
Settings.gitlab_ci['builds_path'] = builds_path
end
 
config.after(:suite) do
Dir.chdir(Rails.root.join("tmp/builds_test")) do
Dir.chdir(builds_path) do
`ls | grep -v .gitkeep | xargs rm -r`
end
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment