comfy 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/comfy.yml +2 -1
- data/lib/comfy/command_executioner.rb +6 -1
- data/lib/comfy/creator.rb +6 -3
- data/lib/comfy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39e377b6deaf5a19408f045af23ac3638bfd6456
|
4
|
+
data.tar.gz: c3ba42298cddb96ec2593a08ee850ad7f5ffdbf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d44cf78939556a0bc924d9ed5fcf577e319593e75032c1b0ca02bd0e46c0e53cb4abd8c1b481dddcc2b7d0ec8e37759ac5fc04a9d3c78fe21886787234e3f73
|
7
|
+
data.tar.gz: 8e0823ec012a5d3e5c81ec97e6320b6c3c7c50fa3ed264d6925c4d396ceffb795e2b8e9f6dd0d3e5260cd5530eac5387c7c352889c40b0288d51b610f5f0a680
|
data/config/comfy.yml
CHANGED
@@ -2,11 +2,12 @@
|
|
2
2
|
production:
|
3
3
|
output-dir: /opt/comfy/virtualmachines/ # Directory to which COMFY will produce virtual machine files
|
4
4
|
cache-dir: /opt/comfy/packer_cache/ # Directory for packer's cache e.g. distribution installation images
|
5
|
-
#template-dir: /opt/comfy/templates/ # When used COMFY uses templates from this directory to create virtual machines
|
5
|
+
#template-dir: /opt/comfy/templates/ # When used, COMFY uses templates from this directory to create virtual machines
|
6
6
|
formats:
|
7
7
|
- qemu
|
8
8
|
size: 10000
|
9
9
|
description: true
|
10
|
+
#packer-binary: # When used, COMFY will use this binary to run Packer instead of the one found by the system in PATH
|
10
11
|
groups: # groups VM belongs to, used when creating cloud-appliance-descriptor
|
11
12
|
- comfy
|
12
13
|
# $t - timestamp
|
@@ -5,7 +5,7 @@ require 'fileutils'
|
|
5
5
|
|
6
6
|
class Comfy::CommandExecutioner < Thor
|
7
7
|
class << self
|
8
|
-
|
8
|
+
|
9
9
|
# Method listing available distributions from template directory.
|
10
10
|
#
|
11
11
|
# @return [Hash] distributions structure containing info about them
|
@@ -148,6 +148,11 @@ class Comfy::CommandExecutioner < Thor
|
|
148
148
|
aliases: '-t',
|
149
149
|
default: Comfy::TEMPLATE_DIR,
|
150
150
|
desc: 'Directory COMFY uses templates from to build a VM'
|
151
|
+
method_option :'packer-binary',
|
152
|
+
type: :string,
|
153
|
+
aliases: '-p',
|
154
|
+
default: Comfy::Settings['packer-binary'],
|
155
|
+
desc: 'Path to Packer binary'
|
151
156
|
|
152
157
|
class_eval %Q^
|
153
158
|
desc '#{plain_name}', 'Builds VM with distribution #{name}'
|
data/lib/comfy/creator.rb
CHANGED
@@ -26,7 +26,7 @@ class Comfy::Creator
|
|
26
26
|
@data = options.clone
|
27
27
|
end
|
28
28
|
|
29
|
-
# Method representing
|
29
|
+
# Method representing the whole creation process. Prepares enviroment,
|
30
30
|
# prepare files and starts packer job.
|
31
31
|
def create
|
32
32
|
logger.info('Preparing for image creation...')
|
@@ -70,12 +70,15 @@ class Comfy::Creator
|
|
70
70
|
# @param packer_file descriptor file with info for packer processing.
|
71
71
|
def run_packer(packer_file)
|
72
72
|
logger.info("Calling Packer - building distribution: '#{data[:distribution]}'.")
|
73
|
-
|
73
|
+
|
74
|
+
packer_binary = data[:'packer-binary'] || 'packer'
|
75
|
+
|
76
|
+
packer = Mixlib::ShellOut.new("#{packer_binary} validate #{packer_file}")
|
74
77
|
packer.run_command
|
75
78
|
|
76
79
|
fail Comfy::Errors::PackerValidationError, "Packer validation failed for distribution '#{data[:distribution]}': #{packer.stdout}" if packer.error?
|
77
80
|
|
78
|
-
packer = Mixlib::ShellOut.new("
|
81
|
+
packer = Mixlib::ShellOut.new("#{packer_binary} build -parallel=false #{packer_file}", timeout: 5400)
|
79
82
|
packer.live_stream = logger
|
80
83
|
packer.run_command
|
81
84
|
|
data/lib/comfy/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: comfy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michal Kimle
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-01-
|
12
|
+
date: 2016-01-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|