karo 2.3.7 → 2.3.8

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: 368231ebc105f20e2014dbf8488c698b5b2503b0
4
- data.tar.gz: cdff0022408ee2d4292ba7e5b0c535aa7700d544
3
+ metadata.gz: 4af1678ba8d7e513d711d893c9036139fbb85ae9
4
+ data.tar.gz: e5695accff3d137118c7c0ec3293622dad51bb90
5
5
  SHA512:
6
- metadata.gz: 4938739b61e6287d56d3da3c0152c41061297229c6db9e32e2ecc18003e5cdce21f0517c8fc367685929e5a29cc4cfe9f3674946412b10284b9ef120ba9f3922
7
- data.tar.gz: ac1ccc32bbe862df547f1262aac1313e6d952df89853f82c8be5e73a547e8c24a4931d2cc653b64357006dd4a6aac8b3ff441b45db137f46924550ae30ec3379
6
+ metadata.gz: b8f59fa373c299500c1ca622ccaeb7c4fe065e4f675ab6a746ebd5bc9197622c9a44f0d41fe2d04ba56e70cedbbeaf15cca690422b0604b324b8a442fb92e41e
7
+ data.tar.gz: 5e981778688c936dc3da4d6f71a7738055c1b8eeac5a7004f80a91675e116ab52a6ca3316e828f3db726fdf2dff53c86d7ab1ed57846e9b9a1d367a9ca97beb2
@@ -4,6 +4,13 @@
4
4
 
5
5
  ### Features
6
6
 
7
+ - Added support for custom assets path
8
+ - Added support doing a dry-run on any command with --dryrun or -d option
9
+
10
+ ## v2.3.7
11
+
12
+ ### Features
13
+
7
14
  - Added support for pulling postgres databases
8
15
 
9
16
  ## v2.3.6
@@ -8,13 +8,33 @@ module Karo
8
8
  include Karo::Common
9
9
 
10
10
  desc "pull", "syncs assets from server shared/system/dragonfly/<environment> directory into local system/dragonfly/development directory"
11
+ long_desc <<-LONGDESC
12
+ You can also change assets server and local path for a given environment in the configuration file
13
+
14
+ e.g. .karo.yml
15
+
16
+ production:
17
+
18
+ --assets:
19
+
20
+ ----server: /data/app/shared/assets
21
+
22
+ ----local: shared/assets
23
+ LONGDESC
11
24
  def pull
12
25
  configuration = Config.load_configuration(options)
13
26
 
14
- path_local = File.expand_path("public/system/dragonfly/development")
15
- empty_directory path_local unless File.exists?(path_local)
27
+ assets = configuration["assets"]
28
+ assets ||= {}
29
+
30
+ path_local = assets["local"]
31
+ path_local ||= "public/system/dragonfly/development"
32
+ path_local = File.expand_path(path_local)
33
+
34
+ empty_directory path_local if !File.exists?(path_local) && !options[:dryrun]
16
35
 
17
- path_server = File.join(configuration["path"], "shared/system/dragonfly/#{options[:environment]}")
36
+ path_server = assets["server"]
37
+ path_server ||= File.join(configuration["path"], "shared/system/dragonfly/#{options[:environment]}")
18
38
 
19
39
  host = "#{configuration["user"]}@#{configuration["host"]}"
20
40
  command = "rsync -az --progress #{host}:#{path_server}/ #{path_local}/"
@@ -25,17 +45,37 @@ module Karo
25
45
  end
26
46
 
27
47
  desc "push", "syncs assets from system/dragonfly/development directory into local server shared/system/dragonfly/<environment> directory"
48
+ long_desc <<-LONGDESC
49
+ You can also change assets server and local path for a given environment in the configuration file
50
+
51
+ e.g. .karo.yml
52
+
53
+ production:
54
+
55
+ --assets:
56
+
57
+ ----server: /data/app/shared/assets
58
+
59
+ ----local: shared/assets
60
+ LONGDESC
28
61
  def push
29
62
  configuration = Config.load_configuration(options)
30
63
 
31
- path_local = File.expand_path("public/system/dragonfly/development")
64
+ assets = configuration["assets"]
65
+ assets ||= {}
66
+
67
+ path_local = assets["local"]
68
+ path_local ||= "public/system/dragonfly/development"
69
+ path_local = File.expand_path(path_local)
70
+
32
71
  unless File.exists?(path_local)
33
72
  raise Thor::Error, "Please make sure that this local path exists? '#{path_local}'"
34
73
  end
35
74
 
36
75
  host = "#{configuration["user"]}@#{configuration["host"]}"
37
76
 
38
- path_server = File.join(configuration["path"], "shared/system/dragonfly/#{options[:environment]}")
77
+ path_server = assets["server"]
78
+ path_server ||= File.join(configuration["path"], "shared/system/dragonfly/#{options[:environment]}")
39
79
 
40
80
  command_1 = "ssh #{host} 'mkdir -p #{path_server}'"
41
81
  command_2 = "rsync -az --progress #{path_local}/ #{host}:#{path_server}/"
@@ -19,6 +19,7 @@ module Karo
19
19
  aliases: "-c", desc: "name of the file containing server configuration"
20
20
  class_option :environment, aliases: "-e", desc: "server environment", default: "production"
21
21
  class_option :verbose, type: :boolean, lazy_default: true, aliases: "-v", desc: "verbose"
22
+ class_option :dryrun, type: :boolean, lazy_default: true, aliases: "-d", desc: "dry-run"
22
23
 
23
24
  desc "cache [search, remove]", "find or clears a specific or all cache from shared/cache directory on the server"
24
25
  subcommand "cache", Cache
@@ -21,7 +21,7 @@ module Karo
21
21
 
22
22
  def run_it(cmd, verbose=false)
23
23
  say cmd, :green if verbose
24
- system cmd
24
+ system cmd unless options[:dryrun]
25
25
  end
26
26
 
27
27
  def git_repo
@@ -2,6 +2,7 @@ production:
2
2
  host: example.com
3
3
  user: deploy
4
4
  path: /data/app_name
5
+ assets_path: /data/app_name/shared/system/dragonfly/production
5
6
  commands:
6
7
  server:
7
8
  memory: watch vmstat -sSM
@@ -1,3 +1,3 @@
1
1
  module Karo
2
- VERSION = "2.3.7"
2
+ VERSION = "2.3.8"
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.3.7
4
+ version: 2.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rahul Trikha
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-10 00:00:00.000000000 Z
11
+ date: 2014-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry