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 +4 -4
- data/lib/capobvious/recipes/import.rb +10 -8
- data/lib/capobvious/recipes/main.rb +7 -4
- data/lib/capobvious/recipes/unicorn.rb +1 -0
- data/lib/capobvious/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: 0fd6f0aa667d4ad7e2ee910daed6ed5419231151
|
4
|
+
data.tar.gz: c02a245ea666ae07c2203de086366ff907e664aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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
|
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
|
-
|
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
|
data/lib/capobvious/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2013-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|