karo 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of karo might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/lib/karo/cli.rb +25 -14
- data/lib/karo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a6208e6d5c789482d34ba5d8deb7d87e739953a
|
4
|
+
data.tar.gz: a4855f848b1ad56b3808695d6bc7be01aeff71c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29d57337e8ae7c563fb93241d7d8e44820096eb0039f5dcc6d84e4add649d3599cb84367d16cdada7456d40d603e70b9465c4f90d9c26b74b6dd934b77a7afe1
|
7
|
+
data.tar.gz: 5e9e9424bfe7507321c410265661c5fd80ba2b28a6f4406d58f4dee354c76e652b1900d8bb69167bb921a87f2e9e91ac3a0b4cd9a59411503812d2a3a7d090ad
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v2.1.0
|
4
|
+
|
5
|
+
### Features
|
6
|
+
|
7
|
+
- Added command 'rake' to run rake tasks for a rails app on a given server environment
|
8
|
+
- Added options to pass extra command line parameters to 'server' command
|
9
|
+
- Added options to pass extra command line parameters to 'client' command
|
10
|
+
- Added options to pass extra command line parameters to 'log' command
|
11
|
+
- Added options to pass extra command line parameters to 'top' command
|
12
|
+
|
3
13
|
## v2.0.0
|
4
14
|
|
5
15
|
### Features
|
data/lib/karo/cli.rb
CHANGED
@@ -77,16 +77,18 @@ module Karo
|
|
77
77
|
|
78
78
|
> Beginning deploy...
|
79
79
|
LONGDESC
|
80
|
-
def client(cmd)
|
80
|
+
def client(cmd, *extra)
|
81
81
|
configuration = Config.load_configuration(options)
|
82
82
|
|
83
83
|
if configuration["commands"] && configuration["commands"]["client"] && configuration["commands"]["client"][cmd]
|
84
84
|
cmd = configuration["commands"]["client"][cmd]
|
85
85
|
end
|
86
86
|
|
87
|
-
|
87
|
+
to_run = "#{cmd} #{extra.flatten.uniq.join(" ")}"
|
88
88
|
|
89
|
-
|
89
|
+
say to_run, :green if options[:verbose]
|
90
|
+
|
91
|
+
system to_run
|
90
92
|
end
|
91
93
|
map clt: :client
|
92
94
|
map local: :client
|
@@ -143,7 +145,7 @@ module Karo
|
|
143
145
|
|
144
146
|
> 25224800 active memory
|
145
147
|
LONGDESC
|
146
|
-
def server(cmd)
|
148
|
+
def server(cmd, *extra)
|
147
149
|
configuration = Config.load_configuration(options)
|
148
150
|
|
149
151
|
ssh = "ssh #{configuration["user"]}@#{configuration["host"]}"
|
@@ -155,7 +157,7 @@ module Karo
|
|
155
157
|
cmd = configuration["commands"]["server"][cmd]
|
156
158
|
end
|
157
159
|
|
158
|
-
to_run = "#{ssh} '#{cmd}'"
|
160
|
+
to_run = "#{ssh} '#{cmd} #{extra.flatten.uniq.join(" ")}'"
|
159
161
|
|
160
162
|
say to_run, :green if options[:verbose]
|
161
163
|
system to_run
|
@@ -164,8 +166,8 @@ module Karo
|
|
164
166
|
map remote: :server
|
165
167
|
|
166
168
|
desc "top", "run top command on a given server environment"
|
167
|
-
def top
|
168
|
-
invoke :server, ["top"]
|
169
|
+
def top(*extra)
|
170
|
+
invoke :server, ["top", extra]
|
169
171
|
end
|
170
172
|
|
171
173
|
desc "ssh", "open ssh console for a given server environment"
|
@@ -189,19 +191,28 @@ module Karo
|
|
189
191
|
invoke :server, [cmd]
|
190
192
|
end
|
191
193
|
|
194
|
+
desc "rake", "run rake commands for a rails app on a given server environment"
|
195
|
+
def rake(command, *extra)
|
196
|
+
configuration = Config.load_configuration(options)
|
197
|
+
|
198
|
+
path = File.join(configuration["path"], "current")
|
199
|
+
cmd = "cd #{path} && export RAILS_ENV=#{options[:environment]} && bundle exec rake #{command}"
|
200
|
+
|
201
|
+
invoke :server, [cmd, extra]
|
202
|
+
end
|
203
|
+
|
192
204
|
desc "log", "displays server log for a given environment"
|
193
|
-
|
205
|
+
class_option :continous, type: :boolean, lazy_default: true, aliases: "-f", desc: "The -f option causes tail to not stop when end of file is reached, but rather to wait for additional data to be appended to the input."
|
206
|
+
def log(*extra)
|
194
207
|
configuration = Config.load_configuration(options)
|
195
208
|
|
196
209
|
path = File.join(configuration["path"], "shared/log/#{options["environment"]}.log")
|
197
210
|
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
cmd = "tail #{path} | grep -A 10 -B 10 #{name}"
|
202
|
-
end
|
211
|
+
cmd = "tail"
|
212
|
+
cmd << " -f" if options[:continous]
|
213
|
+
cmd << " #{path}"
|
203
214
|
|
204
|
-
invoke :server, [cmd]
|
215
|
+
invoke :server, [cmd, extra]
|
205
216
|
end
|
206
217
|
|
207
218
|
desc "version", "displays karo's current version"
|
data/lib/karo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: karo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rahul Trikha
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|