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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7a3ab50878b48d501e5a62cc1b50a619efc60079
4
- data.tar.gz: c35ec93ae09d014d30246133dfe1198839809183
3
+ metadata.gz: 39e377b6deaf5a19408f045af23ac3638bfd6456
4
+ data.tar.gz: c3ba42298cddb96ec2593a08ee850ad7f5ffdbf5
5
5
  SHA512:
6
- metadata.gz: 569853233e11d6cbc832a96dae9a0585b5397e84c8d194b0b47f3b4d1a4a341aa8381b009e565b6c3dfca47e105f420a3471b5d8c65c02cd327b5a88d8b1f566
7
- data.tar.gz: 623454495ac94139aeca1bc5b473f8dc450244671e8727a5f787662373601c1f8301c67de11fcc71e35be597f900406c98fb5ffe38fa2b7b7d865fc71e82ac95
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 thw whole creation process. Prepares enviroment,
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
- packer = Mixlib::ShellOut.new("packer validate #{packer_file}")
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("packer build -parallel=false #{packer_file}", timeout: 5400)
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
@@ -1,3 +1,3 @@
1
1
  module Comfy
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
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.1
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-14 00:00:00.000000000 Z
12
+ date: 2016-01-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler