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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 97b8833811a06035214ec406b17eca422d1bb1fb
4
- data.tar.gz: e6114de86c07bd6bab12db6b2f4339e97c6b09f4
3
+ metadata.gz: 3a6208e6d5c789482d34ba5d8deb7d87e739953a
4
+ data.tar.gz: a4855f848b1ad56b3808695d6bc7be01aeff71c8
5
5
  SHA512:
6
- metadata.gz: ed6f7dec23bf58f66b877ce3ea84e97a3c86d474a6a1a8854ea785da61247175c8874f6f36c96284ceb6a3d76e5c8a6d07265f346ad1dd6e906ceb93a65b1eb2
7
- data.tar.gz: 7e0210d93ebc777cb9d21a9d6d14e7612fae4022fad53b778f27fb683c23556171be88d9780742df67ea49f7b1e5eff52dfb37626e6bb9cb5588598d61b8a259
6
+ metadata.gz: 29d57337e8ae7c563fb93241d7d8e44820096eb0039f5dcc6d84e4add649d3599cb84367d16cdada7456d40d603e70b9465c4f90d9c26b74b6dd934b77a7afe1
7
+ data.tar.gz: 5e9e9424bfe7507321c410265661c5fd80ba2b28a6f4406d58f4dee354c76e652b1900d8bb69167bb921a87f2e9e91ac3a0b4cd9a59411503812d2a3a7d090ad
@@ -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
@@ -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
- say cmd, :green if options[:verbose]
87
+ to_run = "#{cmd} #{extra.flatten.uniq.join(" ")}"
88
88
 
89
- system cmd
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
- def log(name="")
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
- if name.eql?("")
199
- cmd = "tail -f #{path}"
200
- else
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"
@@ -1,3 +1,3 @@
1
1
  module Karo
2
- VERSION = "2.0.0"
2
+ VERSION = "2.1.0"
3
3
  end
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.0.0
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-03 00:00:00.000000000 Z
11
+ date: 2013-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry