capones_recipes 1.12.0 → 1.13.0
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.
@@ -42,16 +42,17 @@ Capistrano::Configuration.instance.load do
|
|
42
42
|
server, port = host_and_port
|
43
43
|
Array(fetch(:sync_directories, [])).each do |syncdir|
|
44
44
|
destination, base = Pathname.new(syncdir).split
|
45
|
-
|
46
|
-
|
47
|
-
logger.info "backup #{syncdir}"
|
48
|
-
run "tar cjf #{shared_path}/sync/#{base}.#{Time.now.strftime '%Y-%m-%d_%H:%M:%S'}.tar.bz2 #{shared_path}/#{syncdir}"
|
49
|
-
purge_old_backups "#{base}"
|
50
|
-
else
|
45
|
+
|
46
|
+
unless File.directory? "#{syncdir}"
|
51
47
|
logger.info "Create '#{syncdir}' directory"
|
52
|
-
run "mkdir #{
|
48
|
+
run "mkdir -p #{shared_path}/#{syncdir}"
|
53
49
|
end
|
54
|
-
|
50
|
+
|
51
|
+
# Make a backup
|
52
|
+
logger.info "backup #{syncdir}"
|
53
|
+
run "tar cjf #{shared_path}/sync/#{base}.#{Time.now.strftime '%Y-%m-%d_%H:%M:%S'}.tar.bz2 #{shared_path}/#{syncdir}"
|
54
|
+
purge_old_backups "#{base}"
|
55
|
+
|
55
56
|
# Sync directory up
|
56
57
|
logger.info "sync #{syncdir} to #{server}:#{port} from local"
|
57
58
|
run_locally "rsync --verbose --archive --compress --keep-dirlinks --delete --stats --rsh='ssh -p #{port}' #{syncdir} #{user}@#{server}:#{shared_path}/#{destination.to_s}"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
Capistrano::Configuration.instance.load do
|
2
|
+
#
|
3
|
+
# Capistrano task for syncing directories.
|
4
|
+
#
|
5
|
+
namespace :sync do
|
6
|
+
after "deploy:finalize_update", "sync:symlink"
|
7
|
+
after "sync:up:fs", "sync:symlink"
|
8
|
+
|
9
|
+
desc "Sets the symlink to sync directories"
|
10
|
+
task :symlink do
|
11
|
+
Array(fetch(:sync_directories, [])).each do |syncdir|
|
12
|
+
unless File.directory? "#{syncdir}"
|
13
|
+
logger.info "Create '#{syncdir}' directory"
|
14
|
+
run "mkdir -p #{shared_path}/#{syncdir}"
|
15
|
+
end
|
16
|
+
|
17
|
+
run "ln -nfs #{shared_path}/#{syncdir} #{latest_release}/#{syncdir}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capones_recipes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 39
|
5
4
|
prerelease:
|
6
|
-
|
7
|
-
- 1
|
8
|
-
- 12
|
9
|
-
- 0
|
10
|
-
version: 1.12.0
|
5
|
+
version: 1.13.0
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
8
|
- Roman Simecek (CyT)
|
@@ -16,7 +11,7 @@ autorequire:
|
|
16
11
|
bindir: bin
|
17
12
|
cert_chain: []
|
18
13
|
|
19
|
-
date: 2011-12-
|
14
|
+
date: 2011-12-15 00:00:00 Z
|
20
15
|
dependencies:
|
21
16
|
- !ruby/object:Gem::Dependency
|
22
17
|
name: capistrano
|
@@ -26,9 +21,6 @@ dependencies:
|
|
26
21
|
requirements:
|
27
22
|
- - ">="
|
28
23
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 3
|
30
|
-
segments:
|
31
|
-
- 0
|
32
24
|
version: "0"
|
33
25
|
type: :runtime
|
34
26
|
version_requirements: *id001
|
@@ -40,9 +32,6 @@ dependencies:
|
|
40
32
|
requirements:
|
41
33
|
- - ">="
|
42
34
|
- !ruby/object:Gem::Version
|
43
|
-
hash: 3
|
44
|
-
segments:
|
45
|
-
- 0
|
46
35
|
version: "0"
|
47
36
|
type: :runtime
|
48
37
|
version_requirements: *id002
|
@@ -54,9 +43,6 @@ dependencies:
|
|
54
43
|
requirements:
|
55
44
|
- - ">="
|
56
45
|
- !ruby/object:Gem::Version
|
57
|
-
hash: 3
|
58
|
-
segments:
|
59
|
-
- 0
|
60
46
|
version: "0"
|
61
47
|
type: :runtime
|
62
48
|
version_requirements: *id003
|
@@ -68,9 +54,6 @@ dependencies:
|
|
68
54
|
requirements:
|
69
55
|
- - ">="
|
70
56
|
- !ruby/object:Gem::Version
|
71
|
-
hash: 3
|
72
|
-
segments:
|
73
|
-
- 0
|
74
57
|
version: "0"
|
75
58
|
type: :runtime
|
76
59
|
version_requirements: *id004
|
@@ -82,9 +65,6 @@ dependencies:
|
|
82
65
|
requirements:
|
83
66
|
- - ">="
|
84
67
|
- !ruby/object:Gem::Version
|
85
|
-
hash: 3
|
86
|
-
segments:
|
87
|
-
- 0
|
88
68
|
version: "0"
|
89
69
|
type: :development
|
90
70
|
version_requirements: *id005
|
@@ -96,9 +76,6 @@ dependencies:
|
|
96
76
|
requirements:
|
97
77
|
- - ">="
|
98
78
|
- !ruby/object:Gem::Version
|
99
|
-
hash: 3
|
100
|
-
segments:
|
101
|
-
- 0
|
102
79
|
version: "0"
|
103
80
|
type: :development
|
104
81
|
version_requirements: *id006
|
@@ -153,6 +130,7 @@ files:
|
|
153
130
|
- lib/capones_recipes/tasks/settings_logic.rb
|
154
131
|
- lib/capones_recipes/tasks/sync.rb
|
155
132
|
- lib/capones_recipes/tasks/sync/fs.rb
|
133
|
+
- lib/capones_recipes/tasks/sync/symlink.rb
|
156
134
|
- lib/capones_recipes/tasks/sync/sync.rb
|
157
135
|
- lib/capones_recipes/tasks/thinking_sphinx.rb
|
158
136
|
- lib/capones_recipes/tasks/utilities.rb
|
@@ -170,18 +148,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
170
148
|
requirements:
|
171
149
|
- - ">="
|
172
150
|
- !ruby/object:Gem::Version
|
173
|
-
hash: 3
|
174
|
-
segments:
|
175
|
-
- 0
|
176
151
|
version: "0"
|
177
152
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
178
153
|
none: false
|
179
154
|
requirements:
|
180
155
|
- - ">="
|
181
156
|
- !ruby/object:Gem::Version
|
182
|
-
hash: 3
|
183
|
-
segments:
|
184
|
-
- 0
|
185
157
|
version: "0"
|
186
158
|
requirements: []
|
187
159
|
|
@@ -192,4 +164,3 @@ specification_version: 3
|
|
192
164
|
summary: Some capistrano recipes for use.
|
193
165
|
test_files: []
|
194
166
|
|
195
|
-
has_rdoc:
|