mofa 0.3.0 → 0.3.1

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.
@@ -86,7 +86,7 @@ class ProvisionCmd < MofaCmd
86
86
  EOF
87
87
  else
88
88
  solo_rb = <<-"EOF"
89
- recipe_url "#{cookbook.cookbooks_url}"
89
+ recipe_url "#{solo_dir}/#{cookbook.pkg_name}"
90
90
  EOF
91
91
  end
92
92
  solo_rb += <<-"EOF"
@@ -151,11 +151,9 @@ class ProvisionCmd < MofaCmd
151
151
  # remotely create data_bag items
152
152
  create_data_bags(sftp, hostname, solo_dir)
153
153
 
154
- if cookbook.instance_of?(SourceCookbook)
155
- puts "Cookbook is a SourceCookbook! Uploading Snapshot Package #{cookbook.pkg_name}... "
156
- sftp.upload!("#{cookbook.pkg_dir}/#{cookbook.pkg_name}", "#{solo_dir}/#{cookbook.pkg_name}")
157
- puts "OK."
158
- end
154
+ puts "Uploading Package #{cookbook.pkg_name}... "
155
+ sftp.upload!("#{cookbook.pkg_dir}/#{cookbook.pkg_name}", "#{solo_dir}/#{cookbook.pkg_name}")
156
+ puts "OK."
159
157
 
160
158
  # Do it -> Execute the chef-solo run!
161
159
  Net::SSH.start(hostname, Mofa::Config::config['ssh_user'], :keys => [Mofa::Config::config['ssh_keyfile']], :port => Mofa::Config.config['ssh_port'], :verbose => :error) do |ssh|
@@ -29,7 +29,8 @@ class ReleasedCookbook < Cookbook
29
29
  set_cookbooks_url
30
30
  end
31
31
 
32
- def execute
32
+ def execute#
33
+ package
33
34
  end
34
35
 
35
36
  def cleanup
@@ -38,6 +39,17 @@ class ReleasedCookbook < Cookbook
38
39
  ok
39
40
  end
40
41
 
42
+ def package
43
+ mkdir_p @pkg_dir
44
+ say "Downloading released cookbook from: #{cookbooks_url} to #{pkg_dir}/#{pkg_name}..."
45
+ File.open("#{pkg_dir}/#{pkg_name}", "wb") do |saved_file|
46
+ # the following "open" is provided by open-uri
47
+ open(cookbooks_url, "rb") do |read_file|
48
+ saved_file.write(read_file.read)
49
+ end
50
+ end
51
+ end
52
+
41
53
  def load_mofa_yml
42
54
  @mofa_yml = MofaYml.load_from_file(".mofa.yml", self)
43
55
  end
data/lib/mofa/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mofa
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mofa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: