veronic 0.0.13 → 0.0.14

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/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  Veronic
2
2
  =======
3
3
 
4
- Veronic, deux qui la tiennent trois qui la niquent is a simple cloud deployer
4
+ Veronic, a simple cloud deployer
5
5
 
6
6
  1) Create veronic directory:
7
7
 
@@ -23,4 +23,4 @@ Usage
23
23
  ````
24
24
  $ gem install veronic
25
25
  $ veronic --help
26
- ````
26
+ ````
@@ -66,12 +66,13 @@ module Provider
66
66
  begin
67
67
  node.run
68
68
  rescue
69
+ puts "Creation of #{@name} failed"
69
70
  self.destroy([node.server.id])
70
71
  self.bootstrap(recursive_count+=1) if recursive_count < 3
71
72
  end
72
73
  end
73
74
 
74
- def destroy(instance_ids = [])
75
+ def destroy(instance_ids=[])
75
76
  puts "Deleting ec2 server #{@name} ..."
76
77
 
77
78
  node = Chef::Knife::Ec2ServerDelete.new()
@@ -32,29 +32,29 @@ module Provider
32
32
 
33
33
  def image
34
34
  puts "Getting image #{@ami_name}..."
35
- @image = get_image
36
- unless @image
37
- sleep 5
38
- @image = get_image
39
- end
40
- if @image
41
- while @image.exists? == false && @image.state != :failed
35
+ @image ||= get_image
36
+ end
37
+
38
+ def get_image
39
+ images = @ec2.images
40
+ my_image = images.with_owner(@owner_id).select {|x| x.name == @ami_name}.first
41
+ unless my_image
42
+ my_image = images[@name]
43
+ unless my_image.exists?
44
+ return false
45
+ end
46
+ else
47
+ while my_image.exists? == false && my_image.state != :failed
42
48
  print "."
43
49
  sleep 1
44
50
  end
45
- while @image.state == :pending && @image.state != :failed
51
+ while my_image.state == :pending && my_image.state != :failed
46
52
  print "."
47
53
  sleep 1
48
54
  end
49
55
  puts ""
50
- return @image
51
- else
52
- return false
53
56
  end
54
- end
55
-
56
- def get_image
57
- @ec2.images.with_owner(@owner_id).select {|x| x.name == @ami_name}.first
57
+ return my_image
58
58
  end
59
59
 
60
60
  end
data/lib/veronic.rb CHANGED
@@ -88,16 +88,13 @@ module Veronic
88
88
  end
89
89
 
90
90
  def deploy
91
- if cloudprovider.instance.exist?
92
- if @environment == 'branch'
93
- query = cloudprovider.instance.dns_name
94
- manual = true
95
- else
96
- query = "role:#{@role}"
97
- manual = false
98
- end
99
- configprovider.ssh(query, @deploy_cmd, manual)
100
- end
91
+ unless @config.deploy_cmd
92
+ abort('Arguments --deploy_cmd is missing')
93
+ end
94
+ bootstrap
95
+ query = cloudprovider.instance.dns_name
96
+ manual = true
97
+ configprovider.ssh(query, @config.deploy_cmd, manual)
101
98
  end
102
99
 
103
100
  def update_instance_dns
@@ -129,7 +126,7 @@ module Veronic
129
126
  if @config.name
130
127
  return cloudprovider.instance.status
131
128
  else
132
- return "Arguments name missing"
129
+ return "Arguments --name is missing"
133
130
  end
134
131
  end
135
132
 
@@ -154,7 +151,7 @@ module Veronic
154
151
 
155
152
  def create_image
156
153
  unless @config.environment
157
- abort('Arguments "environment" missing')
154
+ abort('Arguments --environment is missing')
158
155
  else
159
156
  configprovider.instance.delete_client_key(cloudprovider.instance.dns_name)
160
157
  configprovider.instance.client.destroy
@@ -168,14 +165,14 @@ module Veronic
168
165
  configprovider.instance.set_environment
169
166
  configprovider.instance.set_role
170
167
  else
171
- abort('Arguments "role" or "environment" missing')
168
+ abort('Arguments --role or --environment is missing')
172
169
  end
173
170
  end
174
171
 
175
172
  def get_image
176
173
  if @config.image.nil?
177
174
  unless @config.environment
178
- abort('Arguments "environment" missing')
175
+ abort('Arguments --environment is missing')
179
176
  else
180
177
  @config.image = cloudprovider.image.id
181
178
  end
data/veronic.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'veronic'
3
- s.version = '0.0.13'
3
+ s.version = '0.0.14'
4
4
  s.date = '2013-04-05'
5
5
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
6
- s.summary = "Veronic, deux qui la tiennent trois qui la niquent"
6
+ s.summary = "Veronic, a simple cloud deployer"
7
7
  s.description = "A simple cloud deployer"
8
8
  s.authors = ["Gabriel Klein"]
9
9
  s.email = 'gabriel.klein.fr@gmail.com'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: veronic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -126,5 +126,5 @@ rubyforge_project:
126
126
  rubygems_version: 1.8.24
127
127
  signing_key:
128
128
  specification_version: 3
129
- summary: Veronic, deux qui la tiennent trois qui la niquent
129
+ summary: Veronic, a simple cloud deployer
130
130
  test_files: []