capobvious 0.3.pre20 → 0.3.pre21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5298c0d742a0213839998e0a4b5b77c1be67ec7e
4
- data.tar.gz: b08bed09cccf60623fe104c8ad132f7029511b9a
3
+ metadata.gz: 0fd6f0aa667d4ad7e2ee910daed6ed5419231151
4
+ data.tar.gz: c02a245ea666ae07c2203de086366ff907e664aa
5
5
  SHA512:
6
- metadata.gz: 5349f784aa918732aec4eac7f5e063e8e0b1ac217bfeeaf9f146e7048a3b4384ae1ecca014bd5aab24ed24a958055807544982716bad21aea7457e8c056ce9c2
7
- data.tar.gz: 0ae8015b23022ddb9b14ccea0b2a16bc82decbbd30cdc6a91008fec25ac65e1eed527268782efbcad695f3db54032c44841fb149d16d181a2ac1079cf8395efa
6
+ metadata.gz: 12549997ae8da9f8311f1d8fff00b9a6608354073f1450bed312983c7c10a04ff0390b8d7170ba6ba6add84aaf4ae1607182af70d010127e418f25c97a7b1f46
7
+ data.tar.gz: 31a52d9636529de7dca814531269bbb3c8416d439f9c496d6173ad58972f5a3fd96ebf8a539387778654b4500e593fad575d7fedb6d3e05e5fda990d6071eff0
@@ -1,14 +1,16 @@
1
1
  Capistrano::Configuration.instance(:must_exist).load do
2
2
 
3
3
  namespace :import do
4
- task :sys do
5
- #system "rm -rfv public/system/"
6
- if which('rsync') && local_which('rsync')
7
- logger.important('Importing with rsync', 'import:sys')
8
- system "rsync -avz --rsh='ssh -p#{ssh_port}' #{user}@#{serv}:#{shared_path}/system public/"
9
- else
10
- backup.sys
11
- system "cd public && #{arch_extract} ../#{local_folder_path}/#{sys_file_name}"
4
+ task :sys, :role => :web do
5
+ find_servers_for_task(current_task).each do |current_server|
6
+ if which('rsync') && local_which('rsync')
7
+ logger.important('Importing with rsync', 'import:sys')
8
+ system "rsync -avz --rsh='ssh -p#{current_server.port}' #{user}@#{current_server.host}:#{shared_path}/system public/"
9
+ else
10
+ backup.sys
11
+ system "cd public && #{arch_extract} ../#{local_folder_path}/#{sys_file_name}"
12
+ end
13
+ break
12
14
  end
13
15
  end
14
16
  end
@@ -12,7 +12,8 @@ Capistrano::Configuration.instance(:must_exist).load do
12
12
  _cset :database_yml_path, 'config/database.yml'
13
13
  _cset :auto_migrate, true
14
14
  _cset :assets, true
15
- _cset(:ssh) {"ssh -p #{fetch(:port, 22)} #{user}@#{serv}"}
15
+ _cset :port, 22
16
+ _cset(:ssh) {"ssh -p #{fetch(:port)} #{user}@#{serv}"}
16
17
  _cset(:stage){ rails_env }
17
18
  _cset(:application_env){ "#{application}_#{rails_env}"}
18
19
 
@@ -30,6 +31,10 @@ Capistrano::Configuration.instance(:must_exist).load do
30
31
  return (gemfile_lock =~ /^\s*#{name}\s+\(/)? true : false
31
32
  end
32
33
 
34
+ def current_host
35
+ capture("echo $CAPISTRANO:HOST$").strip
36
+ end
37
+
33
38
  def which(name)
34
39
  str = capture("which #{name}").chop
35
40
  return false if str == ''
@@ -44,9 +49,7 @@ Capistrano::Configuration.instance(:must_exist).load do
44
49
  rescue
45
50
  false
46
51
  end
47
- def ssh_port
48
- exists?(:port) ? fetch(:port) : 22
49
- end
52
+
50
53
  def local_gem_available?(name)
51
54
  Gem::Specification.find_by_name(name)
52
55
  rescue Gem::LoadError
@@ -21,6 +21,7 @@ Capistrano::Configuration.instance(:must_exist).load do
21
21
  puts command
22
22
 
23
23
  run "#{sudo} sed -i 's/exit 0//g' /etc/rc.local"
24
+ run "echo \"# #{application_env}\" | #{sudo} tee -a /etc/rc.local"
24
25
  run "echo \"#{command}\" | #{sudo} tee -a /etc/rc.local"
25
26
  run "echo \"exit 0\" | #{sudo} tee -a /etc/rc.local"
26
27
  end
@@ -1,3 +1,3 @@
1
1
  module Capobvious
2
- VERSION = '0.3.pre20'
2
+ VERSION = '0.3.pre21'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capobvious
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.pre20
4
+ version: 0.3.pre21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Gruzd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-04 00:00:00.000000000 Z
11
+ date: 2013-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano