f2y_aws_tool 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/f2y-aws-tool +13 -9
- data/f2y_aws_tool.gemspec +1 -0
- data/lib/f2y_aws_tool.rb +5 -1
- data/lib/f2y_aws_tool/deploy.rb +15 -2
- data/lib/f2y_aws_tool/version.rb +1 -1
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f5a46a374ae7aba60050cc66b413fd851970e06
|
4
|
+
data.tar.gz: 90f7725f6b32753d4a7656d05ffb0289ee7e305c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31b827b2ffd1868f919ae0661522aa43a5178d40a62fae461b5397659bc3f4cb6dbd20820d94788200b98c9bfcc71a9c27d7f93699654cc03a1baed5b858f3a9
|
7
|
+
data.tar.gz: 014dc1412b33477450e9ccf6bd9a59b8c52420ee7216f90da17370e929ab5d9792cbed06d81de684c6128939135714e63ce7353cef0942b9465ccfaf06c022f3
|
data/bin/f2y-aws-tool
CHANGED
@@ -2,17 +2,21 @@
|
|
2
2
|
require "bundler/setup"
|
3
3
|
require_relative '../lib/f2y_aws_tool'
|
4
4
|
require 'thor'
|
5
|
+
require 'byebug'
|
5
6
|
|
6
7
|
class F2yAwsToolCli < Thor
|
7
|
-
method_option :
|
8
|
-
|
9
|
-
method_option :
|
10
|
-
method_option :
|
11
|
-
method_option :
|
12
|
-
|
13
|
-
method_option :
|
14
|
-
method_option :
|
15
|
-
method_option :
|
8
|
+
method_option :target, desc: "Opsworks Target", type: :hash
|
9
|
+
|
10
|
+
method_option :access_key_id, desc: "AWS Access Key Id", type: :string, default: ENV['AWS_ACCESS_KEY_ID']
|
11
|
+
method_option :secret_access_key, desc: "AWS Secret Access Key", type: :string, default: ENV['AWS_SECRET_ACCESS_KEY']
|
12
|
+
method_option :region, desc: "AWS Opsworks Region", required: false, type: :string
|
13
|
+
|
14
|
+
method_option :wait, desc: "Wait until deploy is completed", type: :boolean, default: true
|
15
|
+
method_option :migrate, desc: "Migrate database", type: :boolean, default: true
|
16
|
+
method_option :log_level, desc: "Log level", type: :string, default: 'INFO', enum: ['DEBUG', 'INFO', 'ERROR']
|
17
|
+
method_option :log_aws, desc: "Enable AWS Log", type: :boolean, default: false
|
18
|
+
|
19
|
+
|
16
20
|
|
17
21
|
desc "deploy", "Deploy Opsworks App"
|
18
22
|
def deploy
|
data/f2y_aws_tool.gemspec
CHANGED
data/lib/f2y_aws_tool.rb
CHANGED
@@ -1,11 +1,15 @@
|
|
1
1
|
require 'aws-sdk'
|
2
2
|
require 'yaml'
|
3
3
|
require 'log4r'
|
4
|
+
require "active_support/hash_with_indifferent_access"
|
4
5
|
|
5
6
|
require_relative "./f2y_aws_tool/version"
|
6
7
|
require_relative "./f2y_aws_tool/deploy"
|
7
8
|
|
8
9
|
module F2yAwsTool
|
10
|
+
|
11
|
+
class MissingAwsCredentials < StandardError; end
|
12
|
+
|
9
13
|
extend self
|
10
14
|
|
11
15
|
include Log4r
|
@@ -18,7 +22,7 @@ module F2yAwsTool
|
|
18
22
|
end
|
19
23
|
|
20
24
|
def log_format
|
21
|
-
@log_format ||= Log4r::PatternFormatter.new(:pattern => "
|
25
|
+
@log_format ||= Log4r::PatternFormatter.new(:pattern => "F2Y-AWS-TOOL::%l %d :: %m", :date_pattern => "%a %d %b %H:%M %p %Y")
|
22
26
|
end
|
23
27
|
|
24
28
|
# Your code goes here...
|
data/lib/f2y_aws_tool/deploy.rb
CHANGED
@@ -43,11 +43,11 @@ module F2yAwsTool
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def stack_id
|
46
|
-
@stack_id ||=
|
46
|
+
@stack_id ||= config.fetch(:stack_id)
|
47
47
|
end
|
48
48
|
|
49
49
|
def app_id
|
50
|
-
@app_id ||=
|
50
|
+
@app_id ||= config.fetch(:app_id)
|
51
51
|
end
|
52
52
|
|
53
53
|
def region
|
@@ -92,6 +92,19 @@ module F2yAwsTool
|
|
92
92
|
)
|
93
93
|
end
|
94
94
|
|
95
|
+
def target
|
96
|
+
@target ||= HashWithIndifferentAccess.new(@options.fetch(:target))
|
97
|
+
end
|
98
|
+
|
99
|
+
def config
|
100
|
+
@config ||= begin
|
101
|
+
HashWithIndifferentAccess.new(YAML.load(File.read(target.fetch(:file))))
|
102
|
+
rescue KeyError
|
103
|
+
target
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
|
95
108
|
|
96
109
|
end
|
97
110
|
|
data/lib/f2y_aws_tool/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: f2y_aws_tool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nakedmoon
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - '='
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 2.7.7
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: activesupport
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - '='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 5.0.1
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - '='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 5.0.1
|
111
125
|
description: Fit2You Amazon Web Services Tool.
|
112
126
|
email:
|
113
127
|
- tore.andrea@gmail.com
|