gantree 0.5.4 → 0.5.5

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
  SHA1:
3
- metadata.gz: c242782702e57708410c762edd84b13c08082398
4
- data.tar.gz: e2c1ba2f4cb50e511700472625b9251eb4752e3f
3
+ metadata.gz: 93e1fc2560310823eff776281bbb89f504e8ccf0
4
+ data.tar.gz: 6202b52059da3c876d4c7bb28d21da5d774abf46
5
5
  SHA512:
6
- metadata.gz: 6de1cebaddcf3fbcd1c78b06976064cd8297e4f4879ec96c8b534394cb6084bdc8fb7fb18e62350c11e084e8ae8f5a18be6147515adc46f2cdbec477a125f2e2
7
- data.tar.gz: b3f18845e6d20e3f950a4ab924cf1ee7298379ab539900fc2d6f045cdc373c0ba53f4397d902b3314ca6350057f8450307d677c55e28c0cea7c555bb4de338c3
6
+ metadata.gz: 047dd9170aa2e325a51abe1ad122bb5b11311d428b579d7187d2798ef6103790bc55dbdbfa7c35f618bf85e314a4f6e38ff53284175a79b41b2b612048e96e1b
7
+ data.tar.gz: a51ebe0952e5182c0364182c327f38f7784a671011ba6d64554235d9e768bc0dd933f392c4c3695f4359c575dd236e3e16b65d1acd6f0aea421ec380e07d4d7f
data/lib/gantree/base.rb CHANGED
@@ -6,6 +6,24 @@ module Gantree
6
6
  raise "Please set your AWS Environment Variables" unless ENV['AWS_SECRET_ACCESS_KEY']
7
7
  raise "Please set your AWS Environment Variables" unless ENV['AWS_ACCESS_KEY_ID']
8
8
  end
9
+
10
+ def self.check_for_updates enabled
11
+ return if $0.include? "bin/gantree"
12
+ latest_version = `gem search gantree | grep gantree | awk '{ print $2 }' | tr -d '()'`.strip
13
+ current_version = `gantree -v`.strip
14
+ puts "Auto updates enabled".light_blue if enabled
15
+ puts "Auto updates disabled".light_blue if !enabled
16
+ if latest_version != current_version && enabled
17
+ puts "Updating from #{current_version} to #{latest_version}...".green
18
+ if system("gem update gantree --force")
19
+ puts "Gem updated".green
20
+ else
21
+ puts "Gem failed to update".red
22
+ end
23
+ else
24
+ puts "gem already up to date".light_blue
25
+ end
26
+ end
9
27
 
10
28
  def print_options
11
29
  @options.each do |param, value|
data/lib/gantree/cli.rb CHANGED
@@ -19,7 +19,9 @@ module Gantree
19
19
  option :autodetect_app_role, :desc => "use naming convention to determin role (true|false)", :type => :boolean, :default => true
20
20
  option :eb_bucket, :desc => "bucket to store elastic beanstalk versions"
21
21
  def deploy name
22
- Gantree::Deploy.new(name, merge_defaults(options)).run
22
+ opts = merge_defaults(options)
23
+ Gantree::Base.check_for_updates(opts[:auto_updates])
24
+ Gantree::Deploy.new(name,opts).run
23
25
  end
24
26
 
25
27
  desc "init IMAGE", "create a dockerrun for your IMAGE"
@@ -98,11 +100,13 @@ module Gantree
98
100
  option :hush, :desc => "quite puts messages", :default => true
99
101
  option :eb_bucket, :desc => "bucket to store elastic beanstalk versions"
100
102
  def ship server
101
- docker = Gantree::Docker.new(merge_defaults(options))
103
+ opts = merge_defaults(options)
104
+ Gantree::Base.check_for_updates(opts[:auto_updates])
105
+ docker = Gantree::Docker.new(opts)
102
106
  docker.pull
103
107
  docker.build
104
108
  docker.push
105
- Gantree::Deploy.new(server, merge_defaults(options)).run
109
+ Gantree::Deploy.new(server,opts).run
106
110
  end
107
111
 
108
112
  map "-v" => :version
@@ -1,3 +1,3 @@
1
1
  module Gantree
2
- VERSION = "0.5.4"
2
+ VERSION = "0.5.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gantree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-22 00:00:00.000000000 Z
11
+ date: 2015-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor