gantree 0.3.0 → 0.3.1

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: 3a0d7adf5bc5062c5e4a37f37f097f04f96c73d4
4
- data.tar.gz: 46a5a976386359a4acba7ded4c19cf7e7640fea4
3
+ metadata.gz: 0cb6e15f60f3733018d0f928c29a83af817661b1
4
+ data.tar.gz: 01859a36842dc0f04d51db423c6f909e572999ed
5
5
  SHA512:
6
- metadata.gz: 91399ef827763928ac3f922876ae86b90137a76ca7d3172419671e37cb7693d63b3af8668baaf4631792e737b0f9eb411c87ac6179f306506ceaa1f3c5876b2b
7
- data.tar.gz: f62e5b8a8fe21c2abc213ce10c75913c76750cb516ec3c750a6a44d059833567f0a905a2fa74b199ed4e5ac913f43bb99855726948ba1ec82431db666cd21421
6
+ metadata.gz: 0f174f4663f90fda347dca5487d4bac5378c8a12cc588d0ae72bf73baa75c54260af17b8b77dcfc2f8a14a30bb5f5e565ec0c6a5e0a80c9f5e597a3808c202aa
7
+ data.tar.gz: 0449db3843c7fa146b3dab388c845887d4f0c793c9169e3fa23e6a881181558aba423e9a1acbd49db7cf245a8d20cd1c0ba24287278aace2e7c6e62477a3de64
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.1.2
1
+ 2.1.3
data/Gemfile CHANGED
@@ -17,5 +17,6 @@ gem "highline"
17
17
  gem "pry"
18
18
  gem "vcr"
19
19
  gem "fakeweb"
20
+ gem "colorize"
20
21
 
21
22
 
data/Gemfile.lock CHANGED
@@ -14,6 +14,7 @@ GEM
14
14
  codeclimate-test-reporter (0.4.0)
15
15
  simplecov (>= 0.7.1, < 1.0.0)
16
16
  coderay (1.1.0)
17
+ colorize (0.7.3)
17
18
  crack (0.4.2)
18
19
  safe_yaml (~> 1.0.0)
19
20
  detabulator (0.1.0)
@@ -92,6 +93,7 @@ DEPENDENCIES
92
93
  aws-sdk-v1
93
94
  cloudformation-ruby-dsl
94
95
  codeclimate-test-reporter
96
+ colorize
95
97
  fakeweb
96
98
  guard
97
99
  guard-bundler
@@ -0,0 +1,26 @@
1
+ require 'colorize'
2
+
3
+ module Gantree
4
+ class App < Base
5
+ attr_reader :app, :env
6
+
7
+ def initialize app, options
8
+ check_credentials
9
+ set_aws_keys
10
+ @options = options
11
+ @app = @options[:env] || default_name(app)
12
+ @env = app
13
+ end
14
+
15
+ def restart
16
+ eb.restart_app_server({environment_name: "#{@env}"})
17
+ puts "App is now restarting".green
18
+ end
19
+
20
+ private
21
+ def eb
22
+ @eb ||= AWS::ElasticBeanstalk::Client.new
23
+ end
24
+ end
25
+ end
26
+
data/lib/gantree/cli.rb CHANGED
@@ -33,7 +33,8 @@ module Gantree
33
33
  method_option :rds, :aliases => "-r", :desc => "(optional) set database type [pg,mysql]"
34
34
  option :dry_run, :aliases => "-d", :desc => "do not actually create the stack"
35
35
  option :docker_version, :desc => "set the version of docker to use as solution stack"
36
- option :dupe, :desc => "use a local cfn folder"
36
+ option :dupe, :desc => "copy an existing template into a new template"
37
+ option :local, :desc => "use a local cfn nested template"
37
38
  def create app
38
39
  Gantree::Stack.new(app, merge_defaults(options)).create
39
40
  end
@@ -51,6 +52,12 @@ module Gantree
51
52
  Gantree::Stack.new(app, merge_defaults(options)).delete
52
53
  end
53
54
 
55
+ desc "restart APP", "restart an eb app"
56
+ option :dry_run, :aliases => "-d", :desc => "do not actually restart"
57
+ def restart app
58
+ Gantree::App.new(app, merge_defaults(options)).restart
59
+ end
60
+
54
61
  protected
55
62
 
56
63
  def merge_defaults(options={})
@@ -1,5 +1,6 @@
1
1
  require 'json'
2
2
  require 'archive/zip'
3
+ require 'colorize'
3
4
  require_relative 'notification'
4
5
 
5
6
  module Gantree
@@ -18,6 +19,7 @@ module Gantree
18
19
  end
19
20
 
20
21
  def run
22
+ check_dir_name unless @options[:force]
21
23
  puts "Deploying #{@env} on #{@app}"
22
24
  print_options
23
25
  return if @options[:dry_run]
@@ -177,6 +179,12 @@ module Gantree
177
179
  `git checkout Dockerrun.aws.json` # reverts back to original Dockerrun.aws.json
178
180
  `rm -rf .ebextensions/` if ext?
179
181
  end
182
+
183
+ def check_dir_name
184
+ dir_name = File.basename(Dir.getwd)
185
+ msg = "WARN: You are deploying from a repo that doesn't match #{@env}"
186
+ puts msg.yellow if @env.include?(dir_name) == false
187
+ end
180
188
  end
181
189
  end
182
190
 
data/lib/gantree/stack.rb CHANGED
@@ -37,7 +37,7 @@ module Gantree
37
37
  @options[:rds_enabled] = rds_enabled? if @options[:rds]
38
38
  print_options
39
39
  create_cfn_if_needed
40
- create_all_templates
40
+ create_all_templates unless @options[:local]
41
41
  upload_templates unless @options[:dry_run]
42
42
  create_aws_cfn_stack unless @options[:dry_run]
43
43
  end
@@ -1,3 +1,3 @@
1
1
  module Gantree
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
data/lib/gantree.rb CHANGED
@@ -4,6 +4,7 @@ require "gantree/version"
4
4
  require "gantree/deploy"
5
5
  require "gantree/init"
6
6
  require "gantree/stack"
7
+ require "gantree/app"
7
8
 
8
9
  module Gantree
9
10
  autoload :CLI, 'gantree/cli'
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.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-09 00:00:00.000000000 Z
11
+ date: 2014-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -268,6 +268,7 @@ files:
268
268
  - bin/gantree
269
269
  - gantree.gemspec
270
270
  - lib/gantree.rb
271
+ - lib/gantree/app.rb
271
272
  - lib/gantree/base.rb
272
273
  - lib/gantree/cfn/beanstalk.rb
273
274
  - lib/gantree/cfn/master.rb