lib/dockly/build_cache/docker.rb in dockly-1.5.0 vs lib/dockly/build_cache/docker.rb in dockly-1.5.1
- old
+ new
@@ -6,11 +6,11 @@
super
image
end
def run_build
- status, body, container = run_command(build_command)
+ status, _, container = run_command(build_command)
raise "Build Cache `#{build_command}` failed to run." unless status.zero?
cache = copy_output_dir(container)
debug "pushing #{output_directory} to s3"
push_to_s3(cache)
debug "pushed #{output_directory} to s3"
@@ -30,11 +30,11 @@
container = ::Docker::Container.create(
'Image' => image.id,
'Cmd' => ['/bin/bash', '-lc', [
"mkdir -p #{File.dirname(output_directory)}",
'&&',
- "tar -xf #{File.join('/', 'host', path)} -C #{File.dirname(output_directory)}"
+ "tar -xf#{'k' if keep_old_files} #{File.join('/', 'host', path)} -C #{File.dirname(output_directory)}"
].join(' ')
],
'Volumes' => {
File.join('/', 'host', path_parent) => { path_parent => 'rw' }
}
@@ -61,20 +61,20 @@
end
def hash_output
ensure_present! :image, :hash_command
@hash_output ||= begin
- status, body, container = run_command(hash_command)
+ status, body, _ = run_command(hash_command)
raise "Hash Command `#{hash_command}` failed to run" unless status.zero?
body
end
end
def parameter_output(command)
ensure_present! :image
raise "Parameter Command tried to run but not found" unless parameter_commands.keys.include?(command)
@parameter_commands[command] ||= begin
- status, body, container = run_command(command)
+ status, body, _ = run_command(command)
raise "Parameter Command `#{command}` failed to run" unless status.zero?
body
end
end