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 +4 -4
- data/breeze.gemspec +1 -1
- data/lib/breeze.rb +1 -1
- data/lib/breeze/fog_extensions.rb +1 -1
- data/lib/breeze/fog_extensions/aws.rb +47 -48
- data/lib/breeze/tasks/configuration.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86062f15d163ae37ac0120e63f495b5cf201a58c42bd02eb7dd45f257342c875
|
4
|
+
data.tar.gz: beccf7bc4af34c6834a51bd36ac9a6d232aed3c26e920ebf29e40a5e5e4a4320
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17f9835e9732fa01c64c48e645f648572841e2789d19e5920376c626e30207af8d7fd0e97c80ce50cb592ae96f6130c7a982e56578dd376bf5fa4b21afd05acb
|
7
|
+
data.tar.gz: a8cb24d809dbaf0784f0cc9bd7a0abc2dd190705e9f3c5dca21d415b91ab6379c08747ad481ff5d7ef1861d0d592098d993334bc9671f056c21b1fa9f93841a5
|
data/breeze.gemspec
CHANGED
data/lib/breeze.rb
CHANGED
@@ -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
|
-
|
7
|
-
|
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
|
-
|
10
|
-
|
11
|
-
|
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
|
-
|
14
|
-
|
15
|
-
|
16
|
-
end
|
31
|
+
def spare_for_rollback!
|
32
|
+
breeze_state('spare_for_rollback')
|
33
|
+
end
|
17
34
|
|
18
|
-
|
19
|
-
|
35
|
+
def spare_for_rollback?
|
36
|
+
breeze_state == 'spare_for_rollback'
|
37
|
+
end
|
20
38
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
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
|
-
|
33
|
-
breeze_state('spare_for_rollback')
|
34
|
-
end
|
48
|
+
private
|
35
49
|
|
36
|
-
|
37
|
-
|
38
|
-
|
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
|
-
|
57
|
-
|
58
|
+
def display_name
|
59
|
+
name or location
|
60
|
+
end
|
58
61
|
|
59
|
-
|
60
|
-
|
61
|
-
|
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
|
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.
|
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-
|
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
|
- - ">="
|