alpha_omega 0.0.136 → 0.0.137
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/alpha_omega/deploy.rb +18 -19
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.137
|
data/lib/alpha_omega/deploy.rb
CHANGED
@@ -64,7 +64,7 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
|
|
64
64
|
_cset(:real_revision) { source.local.query_revision(revision) { |cmd| with_env("LC_ALL", "C") { run_locally(cmd) } } }
|
65
65
|
|
66
66
|
_cset(:current_workarea) { capture("readlink #{current_path} || true").strip.split("/")[-1] }
|
67
|
-
_cset(:
|
67
|
+
_cset(:rollback_release_name) {
|
68
68
|
if releases.length > 0
|
69
69
|
w = current_workarea
|
70
70
|
releases.index(w) && releases[(releases.index(w))%releases.length]
|
@@ -72,7 +72,7 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
|
|
72
72
|
""
|
73
73
|
end
|
74
74
|
}
|
75
|
-
_cset(:
|
75
|
+
_cset(:previous_release_name) {
|
76
76
|
if releases.length > 0
|
77
77
|
w = current_workarea
|
78
78
|
releases.index(w) && releases[(releases.index(w)-1)%releases.length]
|
@@ -80,7 +80,7 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
|
|
80
80
|
""
|
81
81
|
end
|
82
82
|
}
|
83
|
-
_cset(:
|
83
|
+
_cset(:current_release_name) {
|
84
84
|
if releases.length > 0
|
85
85
|
w = current_workarea
|
86
86
|
stage = releases[((releases.index(w)?releases.index(w):-1)+1)%releases.length]
|
@@ -90,7 +90,8 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
|
|
90
90
|
""
|
91
91
|
end
|
92
92
|
}
|
93
|
-
_cset(:
|
93
|
+
_cset (:release_name) { current_release_name } # compact
|
94
|
+
_cset(:next_release_name) {
|
94
95
|
if releases.length > 0
|
95
96
|
w = current_workarea
|
96
97
|
releases.index(w) && releases[(releases.index(w)+1)%releases.length]
|
@@ -119,9 +120,8 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
|
|
119
120
|
|
120
121
|
_cset(:rollback_revision) { capture("cat #{rollback_release}/REVISION", :except => { :no_release => true }).strip }
|
121
122
|
_cset(:previous_revision) { capture("cat #{previous_release}/REVISION", :except => { :no_release => true }).strip }
|
122
|
-
_cset(:current_revision) { capture("cat #{
|
123
|
+
_cset(:current_revision) { capture("cat #{current_release}/REVISION", :except => { :no_release => true }).strip }
|
123
124
|
_cset(:next_revision) { capture("cat #{next_release}/REVISION", :except => { :no_release => true }).strip }
|
124
|
-
_cset(:latest_revision) { capture("cat #{current_release}/REVISION", :except => { :no_release => true }).strip }
|
125
125
|
|
126
126
|
_cset(:run_method) { fetch(:use_sudo, true) ? :sudo : :run }
|
127
127
|
|
@@ -135,11 +135,10 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
|
|
135
135
|
#
|
136
136
|
# with persistent releases, the latest release is always the current release
|
137
137
|
|
138
|
-
_cset(:rollback_release) { File.join(releases_path,
|
139
|
-
_cset(:previous_release) { File.join(releases_path,
|
140
|
-
_cset(:current_release) { File.join(releases_path,
|
141
|
-
_cset(:
|
142
|
-
_cset(:next_release) { File.join(releases_path, next_release_path) }
|
138
|
+
_cset(:rollback_release) { File.join(releases_path, rollback_release_name) }
|
139
|
+
_cset(:previous_release) { File.join(releases_path, previous_release_name) }
|
140
|
+
_cset(:current_release) { File.join(releases_path, current_release_name) }
|
141
|
+
_cset(:next_release) { File.join(releases_path, next_release_name) }
|
143
142
|
|
144
143
|
# =========================================================================
|
145
144
|
# deploy:lock defaults
|
@@ -284,7 +283,7 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
|
|
284
283
|
|
285
284
|
task :symlink_next, :except => { :no_release => true } do
|
286
285
|
if releases.length >= 2
|
287
|
-
run "ln -vsnf #{
|
286
|
+
run "ln -vsnf #{current_release} #{next_path}"
|
288
287
|
end
|
289
288
|
end
|
290
289
|
|
@@ -309,17 +308,17 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
|
|
309
308
|
end
|
310
309
|
|
311
310
|
if releases.length == 1
|
312
|
-
run "ln -vsnf #{
|
311
|
+
run "ln -vsnf #{current_release} #{current_path}"
|
313
312
|
else
|
314
313
|
run "rm -fv #{previous_path} #{next_path}"
|
315
|
-
run "ln -vsnf #{
|
314
|
+
run "ln -vsnf #{current_release} #{current_path}"
|
316
315
|
if current_path != external_path
|
317
316
|
run "#{File.dirname(external_path).index(deploy_to) == 0 ? "" : try_sudo} ln -vsnf #{current_path} #{external_path}"
|
318
317
|
end
|
319
318
|
run "ln -vsnf #{rollback_release} #{previous_path}"
|
320
319
|
end
|
321
320
|
|
322
|
-
system "#{figlet} -w 200 #{
|
321
|
+
system "#{figlet} -w 200 #{current_release_path} activated"
|
323
322
|
end
|
324
323
|
end
|
325
324
|
|
@@ -378,7 +377,7 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
|
|
378
377
|
DESC
|
379
378
|
task :cook, :roles => :app, :except => { :no_release => true } do
|
380
379
|
run_script = <<-SCRIPT
|
381
|
-
set -e; cd #{
|
380
|
+
set -e; cd #{current_release};
|
382
381
|
if [[ -x bin/nuke ]]; then #{ruby_loader} bin/nuke; fi;
|
383
382
|
SCRIPT
|
384
383
|
|
@@ -581,7 +580,7 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
|
|
581
580
|
namespace :ruby do
|
582
581
|
task :bundle do
|
583
582
|
run_script = <<-SCRIPT
|
584
|
-
set -e; cd #{
|
583
|
+
set -e; cd #{current_release};
|
585
584
|
SCRIPT
|
586
585
|
|
587
586
|
run_script += <<-SCRIPT
|
@@ -597,7 +596,7 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
|
|
597
596
|
namespace :node do
|
598
597
|
task :bundle do
|
599
598
|
run_script = <<-SCRIPT
|
600
|
-
set -e; cd #{
|
599
|
+
set -e; cd #{current_release};
|
601
600
|
SCRIPT
|
602
601
|
|
603
602
|
run_script += <<-SCRIPT
|
@@ -610,7 +609,7 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
|
|
610
609
|
|
611
610
|
on :exit do
|
612
611
|
unless local_only
|
613
|
-
put full_log, "#{log_path}/#{application}_last_deploy-#{
|
612
|
+
put full_log, "#{log_path}/#{application}_last_deploy-#{current_release_path}-#{branch.gsub(/\W+/,"_")}.log-#{Time.now.strftime('%Y%m%d-%H%M')}"
|
614
613
|
end
|
615
614
|
end
|
616
615
|
|
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: 269
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 137
|
10
|
+
version: 0.0.137
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- David Nghiem
|