alpha_omega 0.0.222 → 0.0.223
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 +14 -8
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.223
|
data/lib/alpha_omega/deploy.rb
CHANGED
@@ -81,7 +81,13 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
|
|
81
81
|
_cset :releases, [ "alpha", "beta", "omega" ]
|
82
82
|
_cset(:releases_dir) { releases.length > 0 ? "releases" : "" }
|
83
83
|
_cset(:releases_path) { File.join(deploy_to, releases_dir) }
|
84
|
-
_cset(:current_workarea) {
|
84
|
+
_cset(:current_workarea) {
|
85
|
+
unless releases.empty?
|
86
|
+
capture("readlink #{current_path} || true").strip.split("/")[-1] || releases[0]
|
87
|
+
else
|
88
|
+
""
|
89
|
+
end
|
90
|
+
}
|
85
91
|
|
86
92
|
# =========================================================================
|
87
93
|
# releases, paths, names
|
@@ -103,7 +109,7 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
|
|
103
109
|
_cset(:deploy_path) { File.join(deploy_to, deploy_path_name) }
|
104
110
|
|
105
111
|
_cset(:rollback_release_name) {
|
106
|
-
|
112
|
+
unless releases.empty?
|
107
113
|
w = current_workarea
|
108
114
|
releases.index(w) && releases[(releases.index(w))%releases.length]
|
109
115
|
else
|
@@ -111,7 +117,7 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
|
|
111
117
|
end
|
112
118
|
}
|
113
119
|
_cset(:previous_release_name) {
|
114
|
-
|
120
|
+
unless releases.empty?
|
115
121
|
w = current_workarea
|
116
122
|
releases.index(w) && releases[(releases.index(w)-1)%releases.length]
|
117
123
|
else
|
@@ -119,17 +125,17 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
|
|
119
125
|
end
|
120
126
|
}
|
121
127
|
_cset(:current_release_name) {
|
122
|
-
|
128
|
+
unless releases.empty?
|
123
129
|
w = current_workarea
|
124
|
-
|
125
|
-
system "#{figlet} -w 200 on #{
|
126
|
-
|
130
|
+
workarea = releases[((releases.index(w)?releases.index(w):-1)+1)%releases.length]
|
131
|
+
system "#{figlet} -w 200 on #{workarea}"
|
132
|
+
workarea
|
127
133
|
else
|
128
134
|
""
|
129
135
|
end
|
130
136
|
}
|
131
137
|
_cset(:next_release_name) {
|
132
|
-
|
138
|
+
unless releases.empty?
|
133
139
|
w = current_workarea
|
134
140
|
releases.index(w) && releases[(releases.index(w)+1)%releases.length]
|
135
141
|
else
|