alpha_omega 0.0.28 → 0.0.29
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.
- data/Gemfile.lock +1 -1
- data/recipes/alpha_omega/deploy.rb +27 -17
- data/recipes/alpha_omega/version.rb +1 -1
- metadata +24 -24
data/Gemfile.lock
CHANGED
@@ -39,6 +39,8 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
|
|
39
39
|
_cset :root_user, "root"
|
40
40
|
_cset :root_group, "root"
|
41
41
|
|
42
|
+
_cset :dir_perms, "0775"
|
43
|
+
|
42
44
|
# =========================================================================
|
43
45
|
# These variables should NOT be changed unless you are very confident in
|
44
46
|
# what you are doing. Make sure you understand all the implications of your
|
@@ -50,7 +52,7 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
|
|
50
52
|
|
51
53
|
_cset(:strategy) { Capistrano::Deploy::Strategy.new(deploy_via, self) }
|
52
54
|
|
53
|
-
_cset
|
55
|
+
_cset(:version_dir) { releases.length > 0 ? "releases" : "" }
|
54
56
|
_cset :current_dir, "current"
|
55
57
|
_cset :service_dir, "service"
|
56
58
|
_cset :releases, %w(alpha omega)
|
@@ -62,13 +64,21 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
|
|
62
64
|
|
63
65
|
_cset(:current_release) { release_path }
|
64
66
|
_cset(:current_workarea) { capture("readlink #{current_path} || true").strip.split("/")[-1] }
|
65
|
-
_cset(:previous_release) {
|
66
|
-
|
67
|
+
_cset(:previous_release) { if releases.length > 0
|
68
|
+
w = current_workarea
|
69
|
+
releases.index(w) && releases[(releases.index(w)-1)%releases.length] || nil
|
70
|
+
else
|
71
|
+
""
|
72
|
+
end
|
67
73
|
}
|
68
|
-
_cset(:release_name) {
|
69
|
-
|
70
|
-
|
71
|
-
|
74
|
+
_cset(:release_name) { if releases.length > 0
|
75
|
+
w = current_workarea
|
76
|
+
stage = releases[((releases.index(w)?releases.index(w):-1)+1)%releases.length]
|
77
|
+
system "figlet -w 200 on #{stage}"
|
78
|
+
stage
|
79
|
+
else
|
80
|
+
""
|
81
|
+
end
|
72
82
|
}
|
73
83
|
|
74
84
|
_cset(:current_revision) { capture("cat #{current_path}/REVISION", :except => { :no_release => true }).chomp }
|
@@ -203,14 +213,14 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
|
|
203
213
|
end
|
204
214
|
|
205
215
|
task :bootstrap_code, :except => { :no_release => true } do
|
206
|
-
if releases.length
|
207
|
-
run "[[ -d #{deploy_to} ]] || #{try_sudo} install -v -d -m
|
208
|
-
run "#{try_sudo} install -v -d -m
|
216
|
+
if releases.length < 2 # without services and run as root
|
217
|
+
run "[[ -d #{deploy_to} ]] || #{try_sudo} install -v -d -m #{dir_perms} #{try_sudo.empty? ? '' : "-o #{root_user} -g #{root_group}"} #{deploy_to}"
|
218
|
+
run "#{try_sudo} install -v -d -m #{dir_perms} #{try_sudo.empty? ? '' : "-o #{user} -g #{group}"} #{releases_path} #{deploy_to}/log"
|
209
219
|
else
|
210
220
|
dirs = [ releases_path, service_path, "#{deploy_to}/log" ]
|
211
221
|
dir_args = dirs.map {|d| d.sub("#{deploy_to}/", "") }.join(' ')
|
212
|
-
run "#{try_sudo} install -v -d -m
|
213
|
-
run "cd #{deploy_to} && install -v -d -m
|
222
|
+
run "#{try_sudo} install -v -d -m #{dir_perms} #{try_sudo.empty? ? '' : "-o #{user} -g #{group}"} #{deploy_to}"
|
223
|
+
run "cd #{deploy_to} && install -v -d -m #{dir_perms} #{dir_args}"
|
214
224
|
end
|
215
225
|
end
|
216
226
|
|
@@ -244,7 +254,7 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
|
|
244
254
|
end
|
245
255
|
end
|
246
256
|
|
247
|
-
if releases.length
|
257
|
+
if releases.length < 2
|
248
258
|
run "[[ $(readlink #{current_path} 2>&-) = #{latest_release} ]] || #{try_sudo} ln -vsnf #{latest_release} #{current_path}"
|
249
259
|
else
|
250
260
|
run "ln -vsnf #{latest_release} #{current_path}"
|
@@ -467,10 +477,6 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
|
|
467
477
|
|
468
478
|
end # :deploy
|
469
479
|
|
470
|
-
on :exit do
|
471
|
-
put full_log, "#{deploy_to}/log/#{application}_last_deploy_#{release_name}_#{branch}.log-#{Time.now.strftime('%Y%m%d-%H%M')}"
|
472
|
-
end
|
473
|
-
|
474
480
|
namespace :ruby do
|
475
481
|
task :bundle do
|
476
482
|
run_script = <<-SCRIPT
|
@@ -483,5 +489,9 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
|
|
483
489
|
end
|
484
490
|
end
|
485
491
|
|
492
|
+
on :exit do
|
493
|
+
put full_log, "#{deploy_to}/log/#{application}_last_deploy.log-#{Time.now.strftime('%Y%m%d-%H%M')}"
|
494
|
+
end
|
495
|
+
|
486
496
|
end # Capistrano::Configuration
|
487
497
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alpha_omega
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 37
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 29
|
10
|
+
version: 0.0.29
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- David Nghiem
|
@@ -20,7 +20,9 @@ date: 2011-08-31 00:00:00 +00:00
|
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
|
-
|
23
|
+
prerelease: false
|
24
|
+
type: :runtime
|
25
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
26
|
none: false
|
25
27
|
requirements:
|
26
28
|
- - ">="
|
@@ -29,12 +31,12 @@ dependencies:
|
|
29
31
|
segments:
|
30
32
|
- 0
|
31
33
|
version: "0"
|
32
|
-
|
33
|
-
type: :runtime
|
34
|
-
requirement: *id001
|
34
|
+
version_requirements: *id001
|
35
35
|
name: grit
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
|
-
|
37
|
+
prerelease: false
|
38
|
+
type: :runtime
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
38
40
|
none: false
|
39
41
|
requirements:
|
40
42
|
- - ">="
|
@@ -43,12 +45,12 @@ dependencies:
|
|
43
45
|
segments:
|
44
46
|
- 0
|
45
47
|
version: "0"
|
46
|
-
|
47
|
-
type: :runtime
|
48
|
-
requirement: *id002
|
48
|
+
version_requirements: *id002
|
49
49
|
name: HeSYINUvSBZfxqA-foreman
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
|
-
|
51
|
+
prerelease: false
|
52
|
+
type: :runtime
|
53
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
52
54
|
none: false
|
53
55
|
requirements:
|
54
56
|
- - ">="
|
@@ -57,12 +59,12 @@ dependencies:
|
|
57
59
|
segments:
|
58
60
|
- 0
|
59
61
|
version: "0"
|
60
|
-
|
61
|
-
type: :runtime
|
62
|
-
requirement: *id003
|
62
|
+
version_requirements: *id003
|
63
63
|
name: HeSYINUvSBZfxqA-capistrano
|
64
64
|
- !ruby/object:Gem::Dependency
|
65
|
-
|
65
|
+
prerelease: false
|
66
|
+
type: :runtime
|
67
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
66
68
|
none: false
|
67
69
|
requirements:
|
68
70
|
- - ">="
|
@@ -71,12 +73,12 @@ dependencies:
|
|
71
73
|
segments:
|
72
74
|
- 0
|
73
75
|
version: "0"
|
74
|
-
|
75
|
-
type: :runtime
|
76
|
-
requirement: *id004
|
76
|
+
version_requirements: *id004
|
77
77
|
name: HeSYINUvSBZfxqA-capistrano_colors
|
78
78
|
- !ruby/object:Gem::Dependency
|
79
|
-
|
79
|
+
prerelease: false
|
80
|
+
type: :runtime
|
81
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
80
82
|
none: false
|
81
83
|
requirements:
|
82
84
|
- - ">="
|
@@ -85,9 +87,7 @@ dependencies:
|
|
85
87
|
segments:
|
86
88
|
- 0
|
87
89
|
version: "0"
|
88
|
-
|
89
|
-
type: :runtime
|
90
|
-
requirement: *id005
|
90
|
+
version_requirements: *id005
|
91
91
|
name: HeSYINUvSBZfxqA-capistrano_log
|
92
92
|
description: Common reciples for persistent capistrano releases
|
93
93
|
email:
|
@@ -1241,7 +1241,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1241
1241
|
requirements: []
|
1242
1242
|
|
1243
1243
|
rubyforge_project:
|
1244
|
-
rubygems_version: 1.
|
1244
|
+
rubygems_version: 1.5.3
|
1245
1245
|
signing_key:
|
1246
1246
|
specification_version: 3
|
1247
1247
|
summary: alpha_omega capistrano recipes
|