simple_deploy 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +6 -0
- data/lib/simple_deploy/cli.rb +18 -4
- data/lib/simple_deploy/logger.rb +11 -0
- data/lib/simple_deploy/stack/deployment.rb +1 -1
- data/lib/simple_deploy/version.rb +1 -1
- data/simple_deploy.gemspec +1 -1
- metadata +13 -13
data/CHANGELOG
CHANGED
data/lib/simple_deploy/cli.rb
CHANGED
@@ -69,8 +69,10 @@ EOS
|
|
69
69
|
:multi => true
|
70
70
|
opt :environment, "Set the target environment", :type => :string
|
71
71
|
opt :force, "Force a deployment to proceed"
|
72
|
-
opt :
|
73
|
-
|
72
|
+
opt :count, "Count of events returned.", :type => :integer,
|
73
|
+
:default => 3
|
74
|
+
opt :log_level, "Log level to output. Valid levels: debug, info, warn, error", :type => :string,
|
75
|
+
:default => 'info'
|
74
76
|
opt :name, "Stack name to manage", :type => :string
|
75
77
|
opt :template, "Path to the template file", :type => :string
|
76
78
|
end
|
@@ -102,7 +104,18 @@ EOS
|
|
102
104
|
end
|
103
105
|
|
104
106
|
@stacks = Stackster::StackLister.new(:config => @config).all.sort
|
105
|
-
|
107
|
+
|
108
|
+
|
109
|
+
case @cmd
|
110
|
+
when 'ssh'
|
111
|
+
@log_level = 'warn'
|
112
|
+
else
|
113
|
+
@log_level = 'info'
|
114
|
+
end
|
115
|
+
|
116
|
+
@log_level = @opts[:log_level] if @opts[:log_level]
|
117
|
+
|
118
|
+
@logger = SimpleDeployLogger.new :log_level => @log_level
|
106
119
|
|
107
120
|
case @cmd
|
108
121
|
when 'create', 'delete', 'deploy', 'destroy', 'instances',
|
@@ -127,6 +140,7 @@ EOS
|
|
127
140
|
@stack.destroy
|
128
141
|
@logger.info "#{@opts[:name]} destroyed."
|
129
142
|
when 'deploy'
|
143
|
+
@stack.update :attributes => attributes
|
130
144
|
@stack.deploy @opts[:force]
|
131
145
|
when 'environments'
|
132
146
|
Config.new.environments.keys.each { |e| puts e }
|
@@ -144,7 +158,7 @@ EOS
|
|
144
158
|
when 'ssh'
|
145
159
|
puts @stack.send @cmd.to_sym
|
146
160
|
when 'events'
|
147
|
-
puts (@stack.events @opts[:
|
161
|
+
puts (@stack.events @opts[:count]).to_yaml
|
148
162
|
else
|
149
163
|
puts "Unknown command. Use -h for help."
|
150
164
|
end
|
data/lib/simple_deploy/logger.rb
CHANGED
@@ -3,6 +3,7 @@ module SimpleDeploy
|
|
3
3
|
|
4
4
|
def initialize(args = {})
|
5
5
|
@logger = args[:logger] ||= Logger.new(STDOUT)
|
6
|
+
@log_level = args[:log_level] ||= 'info'
|
6
7
|
|
7
8
|
unless args[:logger]
|
8
9
|
@logger.datetime_format = "%Y-%m-%d %H:%M:%S"
|
@@ -11,6 +12,16 @@ module SimpleDeploy
|
|
11
12
|
end
|
12
13
|
end
|
13
14
|
|
15
|
+
case @log_level.downcase
|
16
|
+
when 'info'
|
17
|
+
@logger.level = Logger::INFO
|
18
|
+
when 'debug'
|
19
|
+
@logger.level = Logger::DEBUG
|
20
|
+
when 'warn'
|
21
|
+
@logger.level = Logger::WARN
|
22
|
+
when 'error'
|
23
|
+
@logger.level = Logger::ERROR
|
24
|
+
end
|
14
25
|
@logger
|
15
26
|
end
|
16
27
|
|
@@ -29,7 +29,7 @@ module SimpleDeploy
|
|
29
29
|
|
30
30
|
def ssh
|
31
31
|
@instances.map do |i|
|
32
|
-
"\
|
32
|
+
"\nssh -i #{@ssh_key} -l #{@ssh_user} -L 9998:#{i}:22 -N #{@ssh_gateway} &\nssh -p 9998 localhost"
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
data/simple_deploy.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_deploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-07-
|
12
|
+
date: 2012-07-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70196623215560 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70196623215560
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: capistrano
|
27
|
-
requirement: &
|
27
|
+
requirement: &70196623214760 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,21 +32,21 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70196623214760
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: stackster
|
38
|
-
requirement: &
|
38
|
+
requirement: &70196623213700 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - =
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 0.2.
|
43
|
+
version: 0.2.5
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70196623213700
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: trollop
|
49
|
-
requirement: &
|
49
|
+
requirement: &70196623213200 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70196623213200
|
58
58
|
description: I am designed to deploy artifacts uploaded by Heirloom
|
59
59
|
email:
|
60
60
|
- brett@weav.net
|
@@ -101,7 +101,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
101
101
|
version: '0'
|
102
102
|
segments:
|
103
103
|
- 0
|
104
|
-
hash:
|
104
|
+
hash: 424800808715961970
|
105
105
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
106
|
none: false
|
107
107
|
requirements:
|
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
110
|
version: '0'
|
111
111
|
segments:
|
112
112
|
- 0
|
113
|
-
hash:
|
113
|
+
hash: 424800808715961970
|
114
114
|
requirements: []
|
115
115
|
rubyforge_project: simple_deploy
|
116
116
|
rubygems_version: 1.8.16
|