cutlass 0.1.2 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/Gemfile.lock +1 -1
- data/lib/cutlass.rb +1 -5
- data/lib/cutlass/clean_test_env.rb +2 -2
- data/lib/cutlass/container_control.rb +2 -1
- data/lib/cutlass/local_buildpack.rb +26 -7
- data/lib/cutlass/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a26c39e3aed992a3bce384c77603c159473bdb1a0f39bd86e996806ce26c6c3e
|
4
|
+
data.tar.gz: d829ea4b01eef4b6ac709510cafcac39768b2470852a4db12f8b04fa26231a34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39ceffa9e16f1b0c76e3894bdca69d6bd6a83a19ec90d4f34a593e7361935672800befb0761339571a2cb3dcf4434d8e21f5e96550160038adf9e4d4dc2789a1
|
7
|
+
data.tar.gz: f59429e16a53e8085dbf57fe86ef132e365df58bb014f13d2588814c0617235c9f3f6de389a302243f2cdfa6f6d28ea0f500e0f72e094837666825451fdfff37
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
- Lock LocalBuildpack when generating images to prevent process race conditions https://github.com/heroku/cutlass/pull/9
|
4
|
+
|
5
|
+
## 0.1.6
|
6
|
+
|
7
|
+
- Remove premature error checking from Cutlass.default_buildpack_paths https://github.com/heroku/cutlass/pull/8
|
8
|
+
|
9
|
+
## 0.1.5
|
10
|
+
|
11
|
+
- Expect build.sh scripts to produce a directory named "target" https://github.com/heroku/cutlass/pull/7
|
12
|
+
|
13
|
+
## 0.1.4
|
14
|
+
|
15
|
+
- Cutlass.default_buildpack_paths= now accepts a LocalBuildpack https://github.com/heroku/cutlass/pull/6
|
16
|
+
|
17
|
+
## 0.1.3
|
18
|
+
|
19
|
+
- Do not connect to docker if it's not needed https://github.com/heroku/cutlass/pull/5
|
20
|
+
|
3
21
|
## 0.1.2
|
4
22
|
|
5
23
|
- App.new accepts a buildpack array with the `:default` symbol which acts as a shortcut for `Cutlass.default_buildpack_paths` https://github.com/heroku/cutlass/pull/4
|
data/Gemfile.lock
CHANGED
data/lib/cutlass.rb
CHANGED
@@ -24,11 +24,7 @@ module Cutlass
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def self.default_buildpack_paths=(paths)
|
27
|
-
paths = Array(paths).map { |path| Pathname(path) }
|
28
|
-
|
29
|
-
paths.each do |path|
|
30
|
-
raise "Path must exist on disk #{path}" unless path.exist?
|
31
|
-
end
|
27
|
+
paths = Array(paths).map { |path| path.respond_to?(:exist?) ? path : Pathname(path) }
|
32
28
|
|
33
29
|
@default_buildpack_paths = paths
|
34
30
|
end
|
@@ -35,9 +35,9 @@ module Cutlass
|
|
35
35
|
@skip_keys << key
|
36
36
|
end
|
37
37
|
|
38
|
-
def self.record
|
38
|
+
def self.record(docker: ENV["CUTLASS_CHECK_DOCKER"])
|
39
39
|
@env_diff = EnvDiff.new(skip_keys: @skip_keys)
|
40
|
-
@docker_diff = DockerDiff.new
|
40
|
+
@docker_diff = DockerDiff.new if docker
|
41
41
|
end
|
42
42
|
|
43
43
|
def self.check(docker: ENV["CUTLASS_CHECK_DOCKER"])
|
@@ -29,8 +29,9 @@ module Cutlass
|
|
29
29
|
|
30
30
|
def bash_exec(cmd, exception_on_failure: true)
|
31
31
|
stdout_ish, stderr, status = @container.exec(["bash", "-c", cmd])
|
32
|
+
stdout = stdout_ish.first
|
32
33
|
|
33
|
-
result = BashResult.new(stdout:
|
34
|
+
result = BashResult.new(stdout: stdout, stderr: stderr, status: status)
|
34
35
|
|
35
36
|
return result if result.success?
|
36
37
|
return result unless exception_on_failure
|
@@ -29,6 +29,20 @@ module Cutlass
|
|
29
29
|
@built = false
|
30
30
|
@directory = Pathname(directory)
|
31
31
|
@image_name = "cutlass_local_buildpack_#{SecureRandom.hex(10)}"
|
32
|
+
|
33
|
+
@mutex_file = Tempfile.new
|
34
|
+
end
|
35
|
+
|
36
|
+
def file_lock
|
37
|
+
file = File.open(@mutex_file.path, File::CREAT)
|
38
|
+
file.flock(File::LOCK_EX)
|
39
|
+
yield
|
40
|
+
ensure
|
41
|
+
file.close
|
42
|
+
end
|
43
|
+
|
44
|
+
def exist?
|
45
|
+
@directory.exist?
|
32
46
|
end
|
33
47
|
|
34
48
|
def teardown
|
@@ -44,13 +58,14 @@ module Cutlass
|
|
44
58
|
end
|
45
59
|
|
46
60
|
def call
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
61
|
+
file_lock do
|
62
|
+
return if built?
|
63
|
+
raise "must be directory: #{@directory}" unless @directory.directory?
|
64
|
+
@built = true
|
51
65
|
|
52
|
-
|
53
|
-
|
66
|
+
call_build_sh
|
67
|
+
call_pack_buildpack_package
|
68
|
+
end
|
54
69
|
|
55
70
|
self
|
56
71
|
end
|
@@ -86,7 +101,11 @@ module Cutlass
|
|
86
101
|
puts result.stdout if Cutlass.debug?
|
87
102
|
puts result.stderr if Cutlass.debug?
|
88
103
|
|
89
|
-
|
104
|
+
if result.success?
|
105
|
+
@directory = @directory.join("target")
|
106
|
+
raise "Expected #{build_sh} to produce a directory #{@directory} but it did not" unless @directory.exist?
|
107
|
+
return
|
108
|
+
end
|
90
109
|
|
91
110
|
raise <<~EOM
|
92
111
|
Buildpack build step failed!
|
data/lib/cutlass/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cutlass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- schneems
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-04-
|
11
|
+
date: 2021-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: docker-api
|