gantree 0.2.5 → 0.2.6

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: 2ee447acf88f5cb72f17884a5083bd4851c76411
4
- data.tar.gz: 90247293b2a1bda2dedb9a79672434f15ef1d79d
3
+ metadata.gz: 1b338332d981a5b7f9fdf5481a6586ab2b9f8bed
4
+ data.tar.gz: db5516035b15ed2d4cbc653caed83dea5ddb5057
5
5
  SHA512:
6
- metadata.gz: 4c0d0931b964537a666f3164a2215942842c8cbc5b72d9ca5dfd749c1c611922afb141bd3d848b6f060cccd125aefd21382ef677ec3a8f7cffc6321bb85d3890
7
- data.tar.gz: d76a3deda1e34621f937c3c43e4cbc2af888de7cb5eee20e3d00dd49e3cb4ac5b2d709098eb6ac97b7bbc5441de2dd1ef5c0879791952415487c29f0b4dc14f8
6
+ metadata.gz: 70ef9e1a8f769ca67e3f260a1cf4eec77a8600c1a0b5f425f44755e17c79a92efd55a23ff62d61861032c9b5427ffb1db4cd82be2cf70301834b9ed386353d91
7
+ data.tar.gz: 328ebe29c9e08162c0ec4a5a798b9fdd874aa36317a9ff384e18b5858910a25da7a2fa0ebb74fb50e379101ef4fee3154977b8480081af46bfbfcb0a8e9cef1f
@@ -59,7 +59,8 @@ module Gantree
59
59
  begin
60
60
  @eb.update_environment({
61
61
  :environment_name => @env,
62
- :version_label => @packeged_version
62
+ :version_label => @packeged_version,
63
+ :option_settings => autodetect_app_role
63
64
  })
64
65
  rescue AWS::ElasticBeanstalk::Errors::InvalidParameterValue
65
66
  puts "#{@env} doesn't exist"
@@ -95,15 +96,19 @@ module Gantree
95
96
  IO.write(@dockerrun_file,JSON.pretty_generate(docker))
96
97
  end
97
98
 
98
- def auto_detect_app_role
99
- role = @env.split('-')[2]
100
- unless role == "app"
99
+ def autodetect_app_role
100
+ enabled = @options[:autodetect_app_role]
101
+ if enabled == true || enabled == "true"
102
+ role = @env.split('-')[2]
101
103
  puts "Deploying app as a #{role}"
102
- role_cmd = IO.read("roles/#{role}").gsub("\n",'')
103
- docker = JSON.parse(IO.read(@dockerrun_file))
104
- docker["Cmd"] = role_cmd
105
- IO.write(@dockerrun_file,JSON.pretty_generate(docker))
106
- puts "Setting role cmd to '#{role_cmd}'"
104
+ #role_cmd = IO.read("roles/#{role}").gsub("\n",'')
105
+ #docker = JSON.parse(IO.read(@dockerrun_file))
106
+ #docker["Cmd"] = role_cmd
107
+ #IO.write(@dockerrun_file,JSON.pretty_generate(docker))
108
+ #puts "Setting role cmd to '#{role_cmd}'"
109
+ [{:option_name => "ROLE", :value => role, :namespace => "aws:elasticbeanstalk:application:environment" }]
110
+ else
111
+ []
107
112
  end
108
113
  end
109
114
 
@@ -1,3 +1,3 @@
1
1
  module Gantree
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6"
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.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-30 00:00:00.000000000 Z
11
+ date: 2014-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor