dockly 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +4 -0
- data/lib/dockly/build_cache/base.rb +3 -1
- data/lib/dockly/build_cache/docker.rb +4 -4
- data/lib/dockly/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -93,6 +93,10 @@ The `build_cache` DSL is used to prevent rebuilding assets every build and used
|
|
93
93
|
- required: `false`
|
94
94
|
- default: `false`
|
95
95
|
- description: when using S3, will insert the S3 object tagged as latest in your "s3://s3_bucket/s3_object_prefix" before running the build command to quicken build times
|
96
|
+
- `keep_old_files`
|
97
|
+
- required: `false`
|
98
|
+
- default: `false`
|
99
|
+
- description: if this option is false when using docker, it will overwrite files that already exist in `output_dir`
|
96
100
|
|
97
101
|
`docker`
|
98
102
|
--------
|
@@ -8,13 +8,15 @@ class Dockly::BuildCache::Base
|
|
8
8
|
|
9
9
|
dsl_attribute :s3_bucket, :s3_object_prefix, :use_latest,
|
10
10
|
:hash_command, :build_command, :parameter_commands,
|
11
|
-
:base_dir, :command_dir, :output_dir, :tmp_dir
|
11
|
+
:base_dir, :command_dir, :output_dir, :tmp_dir,
|
12
|
+
:keep_old_files
|
12
13
|
|
13
14
|
default_value :use_latest, false
|
14
15
|
default_value :parameter_commands, {}
|
15
16
|
default_value :command_dir, '.'
|
16
17
|
default_value :output_dir, '.'
|
17
18
|
default_value :tmp_dir, Dir.tmpdir
|
19
|
+
default_value :keep_old_files, false
|
18
20
|
|
19
21
|
def execute!
|
20
22
|
debug "Looking for cache for hash: #{hash_output}"
|
@@ -8,7 +8,7 @@ class Dockly::BuildCache::Docker < Dockly::BuildCache::Base
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def run_build
|
11
|
-
status,
|
11
|
+
status, _, container = run_command(build_command)
|
12
12
|
raise "Build Cache `#{build_command}` failed to run." unless status.zero?
|
13
13
|
cache = copy_output_dir(container)
|
14
14
|
debug "pushing #{output_directory} to s3"
|
@@ -32,7 +32,7 @@ class Dockly::BuildCache::Docker < Dockly::BuildCache::Base
|
|
32
32
|
'Cmd' => ['/bin/bash', '-lc', [
|
33
33
|
"mkdir -p #{File.dirname(output_directory)}",
|
34
34
|
'&&',
|
35
|
-
"tar -xf #{File.join('/', 'host', path)} -C #{File.dirname(output_directory)}"
|
35
|
+
"tar -xf#{'k' if keep_old_files} #{File.join('/', 'host', path)} -C #{File.dirname(output_directory)}"
|
36
36
|
].join(' ')
|
37
37
|
],
|
38
38
|
'Volumes' => {
|
@@ -63,7 +63,7 @@ class Dockly::BuildCache::Docker < Dockly::BuildCache::Base
|
|
63
63
|
def hash_output
|
64
64
|
ensure_present! :image, :hash_command
|
65
65
|
@hash_output ||= begin
|
66
|
-
status, body,
|
66
|
+
status, body, _ = run_command(hash_command)
|
67
67
|
raise "Hash Command `#{hash_command}` failed to run" unless status.zero?
|
68
68
|
body
|
69
69
|
end
|
@@ -73,7 +73,7 @@ class Dockly::BuildCache::Docker < Dockly::BuildCache::Base
|
|
73
73
|
ensure_present! :image
|
74
74
|
raise "Parameter Command tried to run but not found" unless parameter_commands.keys.include?(command)
|
75
75
|
@parameter_commands[command] ||= begin
|
76
|
-
status, body,
|
76
|
+
status, body, _ = run_command(command)
|
77
77
|
raise "Parameter Command `#{command}` failed to run" unless status.zero?
|
78
78
|
body
|
79
79
|
end
|
data/lib/dockly/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dockly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-03-
|
12
|
+
date: 2014-03-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: clamp
|