image_builder 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/image_builder/backends/packer.rb +1 -9
- data/lib/image_builder/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4dad5330712e1e493380c06ce30c27c631bc8668
|
4
|
+
data.tar.gz: 7cc941b95547d231ae5d0f01ded310a8efa65eda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a456a9d62cf45f077491b14500c7fc02989b6dc64c59ea89b84a73e39ed4c02366086f29cbee57b21a09d243ef3df7d902ea6f3599eb01d44c5414a42bd6060
|
7
|
+
data.tar.gz: 1f078bc505be1671a1f324d8ce094bbddeadce32dd179bda7b8effb0f5ccac09946144c95b6ece6aabe097fa3dae0eb75a7af8b3c7d588927151cc017ae0a0f6
|
@@ -16,9 +16,6 @@ module ImageBuilder
|
|
16
16
|
attr_accessor :provisioners
|
17
17
|
attr_accessor :variables
|
18
18
|
|
19
|
-
@@default_path = ['/bin', '/usr/bin', '/sbin', '/usr/sbin', '/usr/local/bin']
|
20
|
-
@@default_path << ::File.join(ENV['GEM_HOME'], 'bin') if ENV.key? 'GEM_HOME'
|
21
|
-
|
22
19
|
@@packer_exe = 'packer'
|
23
20
|
|
24
21
|
def initialize
|
@@ -30,7 +27,6 @@ module ImageBuilder
|
|
30
27
|
|
31
28
|
def self.packer_path(path)
|
32
29
|
@@packer_exe = ::File.expand_path(path)
|
33
|
-
@@default_path.unshift ::File.dirname(::File.expand_path(@@packer_exe))
|
34
30
|
end
|
35
31
|
|
36
32
|
def self.packer_path=(path)
|
@@ -66,16 +62,12 @@ module ImageBuilder
|
|
66
62
|
|
67
63
|
if args.include?('-debug')
|
68
64
|
json_obj = JSON.parse(to_json)
|
69
|
-
|
70
|
-
puts "DEBUG: PACKER_EXE = #{@@packer_exe}"
|
71
|
-
puts "DEBUG: PATH = $PATH:#{@@default_path}"
|
72
65
|
puts 'DEBUG: PACKER_JSON ='
|
73
66
|
puts JSON.pretty_generate(json_obj)
|
74
67
|
end
|
75
68
|
|
76
69
|
# Some provisioners may take a long time to run without giving output (applying OS updates via Chef
|
77
70
|
# to CentOS6, and AMI copying, comes to mind), so extend the timeout to 1.5 hours.
|
78
|
-
# shellout = Mixlib::ShellOut.new(cmd, env: { 'PATH' => @@default_path.join(':') }, input: to_json, timeout: 5400)
|
79
71
|
shellout = Mixlib::ShellOut.new(cmd, input: to_json, timeout: 5400)
|
80
72
|
shellout.live_stdout = STDOUT
|
81
73
|
shellout.live_stderr = STDERR
|
@@ -89,7 +81,7 @@ module ImageBuilder
|
|
89
81
|
cmd = [@@packer_exe, 'validate'].concat(args)
|
90
82
|
cmd << '-'
|
91
83
|
|
92
|
-
shellout = Mixlib::ShellOut.new(cmd,
|
84
|
+
shellout = Mixlib::ShellOut.new(cmd, input: to_json)
|
93
85
|
shellout.inspect
|
94
86
|
shellout.run_command
|
95
87
|
shellout.error!
|