From 1ce150e24c49a0d66f1002db4ed109da7a69869f Mon Sep 17 00:00:00 2001 From: Valeriy Trubachev Date: Thu, 29 Jan 2015 11:55:53 -0600 Subject: [PATCH] configurable path for build script this is to fix builds on systems where /tmp is mounted with noexec --- lib/build.rb | 4 +++- lib/config.rb | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/build.rb b/lib/build.rb index 5842082..ec18bd4 100644 --- a/lib/build.rb +++ b/lib/build.rb @@ -28,7 +28,9 @@ def initialize(data) end def run - @run_file = Tempfile.new("executor") + FileUtils.mkdir_p(config.jobs_dir) unless File.exists?(config.jobs_dir) + + @run_file = Tempfile.new("executor", config.jobs_dir) @run_file.chmod(0700) @commands.unshift(checkout_cmd) diff --git a/lib/config.rb b/lib/config.rb index ab8ca35..cae8c5a 100644 --- a/lib/config.rb +++ b/lib/config.rb @@ -29,6 +29,10 @@ def builds_dir @builds_path ||= File.join($root_path, 'tmp', 'builds') end + def jobs_dir + @jobs_path ||= File.join($root_path, 'tmp', 'jobs') + end + def write(key, value) @config[key] = value