bricky 0.0.17 → 0.0.18
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.
- checksums.yaml +8 -8
- data/etc/bricks/bundle/builder +2 -2
- data/etc/bricks/helper/start +1 -1
- data/etc/bricks/mounts/builder +1 -1
- data/lib/bricky/command.rb +9 -1
- data/lib/bricky/commands/bootstrap.rb +1 -22
- data/lib/bricky/commands/builder.rb +7 -7
- data/lib/bricky/executor.rb +6 -19
- data/lib/bricky/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MzlmNTdkMGM2N2ViMmEzNzE1ZjQ5NjUxYjE1ODU3ODNmYjc1MWI4Yg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MjMxYTA1MzU0NWU4ZmM2ZWJjZDZmYzJhZTVkNTRmNzIwZWEzYjcwOA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MGUwNTc4MmM5N2NmNGNhZGEyZmUxMDI3ZWRkNmVjOWUxZGJkYzBmYjE2ODc0
|
10
|
+
ZTI2Yjk0NTQ4ZmYzOGQyMDRiZDJiNzI5NGRjY2IwMGQ4MjI4MWU3NDhmMTg0
|
11
|
+
MTZkNDY0Yzg0NGY3ZjQ1MTRlYzM4OWIwNWE1M2UzNGM5N2I0MzI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MTIyYzlmYjNhMGM5OTViNGRiYWRiNDA3YTVkZmMyYzg5NTI4NTlmZGIyNmZh
|
14
|
+
ZGVlZDc4YzI3YjQyM2ExM2EzMzM4ZGE5MTUzNmQwYWZlNDllN2VjNzQ3Y2Y0
|
15
|
+
MmJiNGVhMjlhMjNiNjMyZTBmNzIwNWMxZDUzOTk3ZDc5Y2IyMTA=
|
data/etc/bricks/bundle/builder
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#!/bin/bash -
|
1
|
+
#!/bin/bash -e
|
2
2
|
|
3
3
|
. $BRICKS_HOME/suexec
|
4
4
|
|
@@ -8,7 +8,7 @@ bundler() {
|
|
8
8
|
info 'Vendor project with Bundler'
|
9
9
|
pushd /opt/workspace/source
|
10
10
|
command -v bundle > /dev/null 2>&1 || gem install --no-ri --no-rdoc bundler
|
11
|
-
bundle install --deployment --
|
11
|
+
bundle install --deployment --without=$BRICKS_BUNDLE_WITHOUT
|
12
12
|
popd
|
13
13
|
}
|
14
14
|
|
data/etc/bricks/helper/start
CHANGED
data/etc/bricks/mounts/builder
CHANGED
data/lib/bricky/command.rb
CHANGED
@@ -19,9 +19,17 @@ module Bricky
|
|
19
19
|
|
20
20
|
desc :builder, "build project"
|
21
21
|
method_option :shell, :type => :boolean, :aliases => "-s"
|
22
|
+
method_option :debugger, :type => :boolean, :aliases => "-d"
|
23
|
+
method_option :"just-image", :type => :boolean, :aliases => "-i"
|
22
24
|
def builder
|
25
|
+
Bricky.logger.level = Logger::DEBUG if options['debugger']
|
26
|
+
|
23
27
|
requirements.check_and_execute do
|
24
|
-
|
28
|
+
if options['just-image']
|
29
|
+
dispatch(:bootstrap)
|
30
|
+
else
|
31
|
+
dispatch(:bootstrap) && dispatch(:builder)
|
32
|
+
end
|
25
33
|
end
|
26
34
|
end
|
27
35
|
|
@@ -6,12 +6,7 @@ module Bricky
|
|
6
6
|
class Bootstrap < Base
|
7
7
|
def execute
|
8
8
|
logger.important "Boostraping images"
|
9
|
-
|
10
|
-
if need_rebuild?
|
11
|
-
build(image)
|
12
|
-
else
|
13
|
-
logger.message "Skipping bootstrap process"
|
14
|
-
end
|
9
|
+
build(image)
|
15
10
|
end
|
16
11
|
|
17
12
|
private
|
@@ -28,7 +23,6 @@ module Bricky
|
|
28
23
|
end
|
29
24
|
end
|
30
25
|
|
31
|
-
make_cache!
|
32
26
|
true
|
33
27
|
end
|
34
28
|
|
@@ -62,21 +56,6 @@ module Bricky
|
|
62
56
|
def cache_file
|
63
57
|
"#{Bricky.config.cache_path}/builder"
|
64
58
|
end
|
65
|
-
|
66
|
-
def need_rebuild?
|
67
|
-
cache_digest = open(cache_file).read rescue "dummy"
|
68
|
-
image_digest = Digest::MD5.file(image.full_path).hexdigest
|
69
|
-
|
70
|
-
return false if cache_digest.eql?(image_digest)
|
71
|
-
true
|
72
|
-
end
|
73
|
-
|
74
|
-
def make_cache!
|
75
|
-
FileUtils::mkdir_p(Bricky.config.cache_path)
|
76
|
-
open(cache_file, 'w') do |file|
|
77
|
-
file.write Digest::MD5.file(image.full_path).hexdigest
|
78
|
-
end
|
79
|
-
end
|
80
59
|
end
|
81
60
|
end
|
82
61
|
end
|
@@ -14,9 +14,8 @@ module Bricky
|
|
14
14
|
attach_shims
|
15
15
|
code = command(images)
|
16
16
|
logger.debug format(code)
|
17
|
-
|
18
|
-
|
19
|
-
unless Bricky::Executor.popen(nil, code)
|
17
|
+
|
18
|
+
unless Bricky::Executor.system(code)
|
20
19
|
logger.failure '~~~~~~~~~~~ Problems building image ~~~~~~~~~~~'
|
21
20
|
return false
|
22
21
|
end
|
@@ -25,7 +24,8 @@ module Bricky
|
|
25
24
|
end
|
26
25
|
|
27
26
|
def command(image)
|
28
|
-
|
27
|
+
iteractive_hacks = options['shell'] ? "-i -t" : ""
|
28
|
+
"docker run --rm #{envs} #{arguments} #{iteractive_hacks} #{image.name} /bricks/helper/start"
|
29
29
|
end
|
30
30
|
|
31
31
|
def format(command)
|
@@ -54,9 +54,9 @@ module Bricky
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def attach_shims
|
57
|
-
|
58
|
-
|
59
|
-
|
57
|
+
shim = Bricky.config.shim_path
|
58
|
+
FileUtils.safe_unlink(shim) if File.exist?(shim)
|
59
|
+
FileUtils.symlink(Bricky.config.bricks_path, shim)
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
data/lib/bricky/executor.rb
CHANGED
@@ -1,27 +1,14 @@
|
|
1
|
-
require "
|
1
|
+
require "open3"
|
2
2
|
|
3
3
|
module Bricky
|
4
4
|
module Executor
|
5
5
|
extend self
|
6
6
|
|
7
7
|
def popen(label, command)
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
if label.nil?
|
13
|
-
logger.info line.chomp
|
14
|
-
else
|
15
|
-
logger.normal label, ": #{line.chomp}"
|
16
|
-
end
|
17
|
-
end
|
18
|
-
rescue Errno::EIO
|
19
|
-
ensure
|
20
|
-
Process.wait wait
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
$?.exitstatus.to_i.eql?(0)
|
8
|
+
Open3.popen2e(command) do |input, output, wait|
|
9
|
+
output.each { |line| logger.normal label, ": #{line.chomp}" }
|
10
|
+
wait.value.to_i.eql?(0)
|
11
|
+
end
|
25
12
|
end
|
26
13
|
|
27
14
|
def system(command)
|
@@ -30,7 +17,7 @@ module Bricky
|
|
30
17
|
|
31
18
|
private
|
32
19
|
def logger
|
33
|
-
|
20
|
+
Bricky.logger
|
34
21
|
end
|
35
22
|
end
|
36
23
|
end
|
data/lib/bricky/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bricky
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- andrerocker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|