dust-deploy 0.1.6 → 0.1.7

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.
data/bin/dust CHANGED
@@ -70,32 +70,14 @@ module Dust
70
70
  # run specified recipes in the given context
71
71
  def run_recipes context
72
72
  @nodes.each do |node|
73
- recipes = {}
74
-
75
- # skip this node if there are no recipes found
73
+ # skip this node if there are no recipes found
76
74
  next unless node['recipes']
77
-
78
- # generate list of recipes for this node
79
- node['recipes'].each do |recipe, ingredients|
80
-
81
- # in case --recipes was set, skip unwanted recipes
82
- next unless options[:recipes].include?(recipe) if options[:recipes]
83
-
84
- # skip disabled recipes
85
- next if ingredients == 'disabled'
86
-
87
- # check if method and thor task actually exist
88
- k = Thor::Util.find_by_namespace recipe
89
- next unless k
90
- next unless k.method_defined? context
91
-
92
- recipes[recipe] = ingredients
93
- end
75
+
76
+ recipes = generate_recipes node, context
94
77
 
95
78
  # skip this node unless we're actually having recipes to cook
96
79
  next if recipes.empty?
97
80
 
98
-
99
81
  # connect to server
100
82
  server = Server.new node
101
83
  next unless server.connect
@@ -111,6 +93,28 @@ module Dust
111
93
  server.disconnect
112
94
  end
113
95
  end
96
+
97
+ # generate list of recipes for this node
98
+ def generate_recipes node, context
99
+ recipes = {}
100
+ node['recipes'].each do |recipe, ingredients|
101
+
102
+ # in case --recipes was set, skip unwanted recipes
103
+ next unless options[:recipes].include?(recipe) if options[:recipes]
104
+
105
+ # skip disabled recipes
106
+ next if ingredients == 'disabled'
107
+
108
+ # check if method and thor task actually exist
109
+ k = Thor::Util.find_by_namespace recipe
110
+ next unless k
111
+ next unless k.method_defined? context
112
+
113
+ recipes[recipe] = ingredients
114
+ end
115
+ recipes
116
+ end
117
+
114
118
 
115
119
  # overwrite thorfiles to look for tasks in the recipes directories
116
120
  def thorfiles(relevant_to=nil, skip_lookup=false)
@@ -83,6 +83,10 @@ class Repositories < Thor
83
83
  else
84
84
  ::Dust.print_failed 'os not supported'
85
85
  end
86
+
87
+ # fetch new stuff
88
+ puts
89
+ node.update_repos
86
90
  end
87
91
  end
88
92
 
data/lib/dust/server.rb CHANGED
@@ -202,7 +202,7 @@ module Dust
202
202
  def update_repos quiet=false, indent=1
203
203
  Dust.print_msg('updating system repositories', indent) unless quiet
204
204
  if uses_apt? true
205
- Dust.print_result exec('DEBIAN_FRONTEND=noninteractive aptitude update')[:exit_code], quiet
205
+ Dust.print_result exec('aptitude update')[:exit_code], quiet
206
206
  elsif uses_emerge? true
207
207
  Dust.print_result exec('emerge --sync')[:exit_code], quiet
208
208
  elsif uses_rpm? true
data/lib/dust/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dust
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 6
9
- version: 0.1.6
8
+ - 7
9
+ version: 0.1.7
10
10
  platform: ruby
11
11
  authors:
12
12
  - kris kechagia
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-12-25 00:00:00 +01:00
17
+ date: 2011-12-30 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency