breeze 0.3.0 → 0.4.0

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
  SHA256:
3
- metadata.gz: 8cbe49dc7266d501871c867615883a26be88ae0b7e3214fb0ee69aae47b4cd20
4
- data.tar.gz: 132fffc563849e62864d60bb9de2e7e13ecc24388bd9d723d330d63b794de50e
3
+ metadata.gz: 86062f15d163ae37ac0120e63f495b5cf201a58c42bd02eb7dd45f257342c875
4
+ data.tar.gz: beccf7bc4af34c6834a51bd36ac9a6d232aed3c26e920ebf29e40a5e5e4a4320
5
5
  SHA512:
6
- metadata.gz: '092dfcc5be9dc5c4322cbd6f861df5f0e56036baa1414f5230d59cb4a6bf899539cea444154b7d169fece3c6324394de0c2bbf3d960fd0470f17dec6c7a7adbf'
7
- data.tar.gz: b4064738219edfc60e5ee79822ac1722dcc6b983e396fdd35a0689f33f3b3adaa8e16862d727cd2fab87343e9727fb7912e8bc81e6fe193d4bad6ebf1130af9a
6
+ metadata.gz: 17f9835e9732fa01c64c48e645f648572841e2789d19e5920376c626e30207af8d7fd0e97c80ce50cb592ae96f6130c7a982e56578dd376bf5fa4b21afd05acb
7
+ data.tar.gz: a8cb24d809dbaf0784f0cc9bd7a0abc2dd190705e9f3c5dca21d415b91ab6379c08747ad481ff5d7ef1861d0d592098d993334bc9671f056c21b1fa9f93841a5
@@ -24,7 +24,7 @@ END_DESCRIPTION
24
24
  s.require_paths = ["lib"]
25
25
 
26
26
  s.add_dependency('thor')
27
- s.add_dependency('fog')
27
+ s.add_dependency('fog-aws')
28
28
  s.add_development_dependency "rake"
29
29
  s.add_development_dependency "cucumber"
30
30
  s.add_development_dependency "aruba"
@@ -1,6 +1,6 @@
1
1
  module Breeze
2
2
 
3
- VERSION = "0.3.0"
3
+ VERSION = "0.4.0"
4
4
  autoload :Veur, 'breeze/veur'
5
5
 
6
6
  end
@@ -1,2 +1,2 @@
1
- require 'fog'
1
+ require 'fog-aws'
2
2
  require 'breeze/fog_extensions/aws'
@@ -2,69 +2,68 @@ require 'fog/aws/models/compute/server'
2
2
  require 'fog/aws/models/compute/image'
3
3
 
4
4
  module Fog
5
+ module AWS
6
+ class Compute
7
+ class Server
8
+ def name
9
+ breeze_data['name'] || tags['Name']
10
+ end
5
11
 
6
- module Compute
7
- class AWS::Server
12
+ def display_name
13
+ return "#{state}:#{name}" if name and state != 'running'
14
+ name || public_ip_address || "#{state} #{flavor_id} #{id}"
15
+ end
8
16
 
9
- def name
10
- breeze_data['name'] || tags['Name']
11
- end
17
+ def running? ; current_state == 'running' ; end
18
+ def stopped? ; current_state == 'stopped' ; end
19
+
20
+ # Get or set meta data that is saved in a tag.
21
+ def breeze_data(new_values=nil)
22
+ if new_values
23
+ tags['breeze-data'] = new_values.map{ |k,v| v.nil? ? v : "#{k}:#{v}" }.compact.join(';')
24
+ # thor("server:tag:create #{id} breeze-data '#{tags['breeze-data']}'")
25
+ Breeze::Server::Tag.new.create(id, 'breeze-data', tags['breeze-data'])
26
+ else
27
+ Hash[tags['breeze-data'].to_s.split(';').map{ |s| s.split(':') }]
28
+ end
29
+ end
12
30
 
13
- def display_name
14
- return "#{state}:#{name}" if name and state != 'running'
15
- name || public_ip_address || "#{state} #{flavor_id} #{id}"
16
- end
31
+ def spare_for_rollback!
32
+ breeze_state('spare_for_rollback')
33
+ end
17
34
 
18
- def running? ; current_state == 'running' ; end
19
- def stopped? ; current_state == 'stopped' ; end
35
+ def spare_for_rollback?
36
+ breeze_state == 'spare_for_rollback'
37
+ end
20
38
 
21
- # Get or set meta data that is saved in a tag.
22
- def breeze_data(new_values=nil)
23
- if new_values
24
- tags['breeze-data'] = new_values.map{ |k,v| v.nil? ? v : "#{k}:#{v}" }.compact.join(';')
25
- # thor("server:tag:create #{id} breeze-data '#{tags['breeze-data']}'")
26
- Breeze::Server::Tag.new.create(id, 'breeze-data', tags['breeze-data'])
27
- else
28
- Hash[tags['breeze-data'].to_s.split(';').map{ |s| s.split(':') }]
39
+ # Get or set the state tag.
40
+ def breeze_state(new_state=nil)
41
+ if new_state
42
+ breeze_data(breeze_data.merge('state' => new_state))
43
+ else
44
+ breeze_data['state']
45
+ end
29
46
  end
30
- end
31
47
 
32
- def spare_for_rollback!
33
- breeze_state('spare_for_rollback')
34
- end
48
+ private
35
49
 
36
- def spare_for_rollback?
37
- breeze_state == 'spare_for_rollback'
38
- end
39
-
40
- # Get or set the state tag.
41
- def breeze_state(new_state=nil)
42
- if new_state
43
- breeze_data(breeze_data.merge('state' => new_state))
44
- else
45
- breeze_data['state']
50
+ def current_state
51
+ reload
52
+ state
46
53
  end
47
- end
48
-
49
- private
50
54
 
51
- def current_state
52
- reload
53
- state
54
55
  end
56
+ class Image
55
57
 
56
- end
57
- class AWS::Image
58
+ def display_name
59
+ name or location
60
+ end
58
61
 
59
- def display_name
60
- name or location
61
- end
62
+ def full_type
63
+ "#{type}, #{architecture}, #{root_device_type}"
64
+ end
62
65
 
63
- def full_type
64
- "#{type}, #{architecture}, #{root_device_type}"
65
66
  end
66
-
67
67
  end
68
68
  end
69
-
70
69
  end
@@ -11,7 +11,7 @@ module Breeze
11
11
 
12
12
  desc 'deploy_to_localhost [FILE]',
13
13
  'Transform and deploy server configuration files to the local file system based on ERB templates in config/server'
14
- method_option :force, :default => false, :desc => 'Overwrite and execute @post commands even if files would not change'
14
+ method_option :force, type: :boolean, default: false, :desc => 'Overwrite and execute @post commands even if files would not change'
15
15
  def deploy_to_localhost(file_pattern='config/breeze/configs/**/*')
16
16
  Dir[file_pattern].sort.each do |path|
17
17
  transform_and_deploy(path, options[:force]) unless File.directory?(path)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: breeze
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Bengts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-29 00:00:00.000000000 Z
11
+ date: 2018-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: fog
28
+ name: fog-aws
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="