alpha_omega 0.0.62 → 0.0.63
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/alpha_omega/deploy.rb +4 -1
- data/lib/alpha_omega/utils.rb +48 -8
- data/lib/alpha_omega/version.rb +1 -1
- data/libexec/hosts +8 -0
- metadata +16 -15
data/lib/alpha_omega/deploy.rb
CHANGED
@@ -47,6 +47,7 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
|
|
47
47
|
|
48
48
|
_cset :current_pod, "default"
|
49
49
|
_cset :last_pod, nil
|
50
|
+
_cset :local_only, ENV['LOCAL_ONLY'] ? true : false
|
50
51
|
|
51
52
|
_cset (:figlet) { [%x(which figlet).strip].reject {|f| !(File.executable? f)}.first || echo }
|
52
53
|
|
@@ -574,7 +575,9 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
|
|
574
575
|
end
|
575
576
|
|
576
577
|
on :exit do
|
577
|
-
|
578
|
+
unless local_only
|
579
|
+
put full_log, "#{log_path}/#{application}_last_deploy-#{release_name}-#{branch.gsub(/\W+/,"_")}.log-#{Time.now.strftime('%Y%m%d-%H%M')}"
|
580
|
+
end
|
578
581
|
end
|
579
582
|
|
580
583
|
end # Capistrano::Configuration
|
data/lib/alpha_omega/utils.rb
CHANGED
@@ -2,17 +2,28 @@ require 'capistrano'
|
|
2
2
|
|
3
3
|
module AlphaOmega
|
4
4
|
|
5
|
+
def self.echo_magic
|
6
|
+
"eea914aaa8dde6fdae29242b1084a2b0415eefaf"
|
7
|
+
end
|
8
|
+
|
5
9
|
def self.default_pods_tasks
|
6
10
|
Proc.new do |config, pod_name, pod, mix_pods|
|
7
11
|
# world task accumulates all.* after tasks
|
8
12
|
config.task "world" do
|
9
13
|
end
|
10
14
|
|
15
|
+
config.task "world.echo" do
|
16
|
+
end
|
17
|
+
|
11
18
|
# each pod task sets the pod context for host/group tasks
|
12
19
|
config.task pod_name do
|
13
20
|
set :current_pod, pod_name
|
14
21
|
end
|
15
22
|
|
23
|
+
config.task "#{pod_name}.echo" do
|
24
|
+
set :current_pod, pod_name
|
25
|
+
end
|
26
|
+
|
16
27
|
hosts =
|
17
28
|
AlphaOmega.what_hosts pod do |task_name, remote_name, node|
|
18
29
|
config.task "#{task_name}.#{pod_name}" do
|
@@ -22,9 +33,29 @@ module AlphaOmega
|
|
22
33
|
config.task task_name do
|
23
34
|
after task_name, "#{task_name}.#{current_pod}"
|
24
35
|
end
|
36
|
+
|
37
|
+
config.task "#{task_name}.#{pod_name}.echo" do
|
38
|
+
puts "#{AlphaOmega.echo_magic} #{task_name}"
|
39
|
+
end
|
40
|
+
|
41
|
+
config.task "#{task_name}.echo" do
|
42
|
+
after "#{task_name}.echo", "#{task_name}.#{current_pod}.echo"
|
43
|
+
end
|
44
|
+
|
25
45
|
end
|
26
46
|
|
27
47
|
AlphaOmega.what_groups hosts do |task_name, nodes|
|
48
|
+
if task_name == "all"
|
49
|
+
# simulate all podXX all
|
50
|
+
unless pod_name == "default"
|
51
|
+
config.after "world", pod_name
|
52
|
+
config.after "world.echo", "#{pod_name}.echo"
|
53
|
+
end
|
54
|
+
|
55
|
+
config.after "world", task_name
|
56
|
+
config.after "world.echo", "#{task_name}.echo"
|
57
|
+
end
|
58
|
+
|
28
59
|
config.task "#{task_name}.#{pod_name}" do
|
29
60
|
unless mix_pods
|
30
61
|
if last_pod && last_pod != pod_name
|
@@ -39,17 +70,26 @@ module AlphaOmega
|
|
39
70
|
end
|
40
71
|
end
|
41
72
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
73
|
+
config.task task_name do
|
74
|
+
after task_name, "#{task_name}.#{current_pod}"
|
75
|
+
end
|
76
|
+
|
77
|
+
config.task "#{task_name}.#{pod_name}.echo" do
|
78
|
+
unless mix_pods
|
79
|
+
if last_pod && last_pod != pod_name
|
80
|
+
puts "ERROR: cannot call tasks that mix different dc_env (last pod = #{last_pod}, current pod = #{pod_name})"
|
81
|
+
exit 1
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
set :last_pod, pod_name
|
86
|
+
nodes.keys.sort.each do |remote_name|
|
87
|
+
puts "#{AlphaOmega.echo_magic} #{remote_name}"
|
46
88
|
end
|
47
|
-
|
48
|
-
config.after "world", task_name
|
49
89
|
end
|
50
90
|
|
51
|
-
config.task task_name do
|
52
|
-
after task_name, "#{task_name}.#{current_pod}"
|
91
|
+
config.task "#{task_name}.echo" do
|
92
|
+
after "#{task_name}.echo", "#{task_name}.#{current_pod}.echo"
|
53
93
|
end
|
54
94
|
end
|
55
95
|
end
|
data/lib/alpha_omega/version.rb
CHANGED
data/libexec/hosts
ADDED
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: 97
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 63
|
10
|
+
version: 0.0.63
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- David Nghiem
|
@@ -116,27 +116,28 @@ files:
|
|
116
116
|
- LICENSE
|
117
117
|
- README.mkd
|
118
118
|
- Procfile.rb
|
119
|
-
- libexec/compare
|
120
|
-
- libexec/rollback
|
121
|
-
- libexec/shell
|
122
119
|
- libexec/major
|
123
|
-
- libexec/patch
|
124
120
|
- libexec/deploy
|
121
|
+
- libexec/rollback
|
122
|
+
- libexec/hosts
|
123
|
+
- libexec/compare
|
125
124
|
- libexec/stage
|
126
|
-
-
|
127
|
-
-
|
128
|
-
- lib/alpha_omega/utils.rb
|
129
|
-
- lib/alpha_omega/deploy/remote_dependency.rb
|
130
|
-
- lib/alpha_omega/deploy/strategy.rb
|
131
|
-
- lib/alpha_omega/deploy/dependencies.rb
|
132
|
-
- lib/alpha_omega/deploy/scm.rb
|
125
|
+
- libexec/patch
|
126
|
+
- libexec/shell
|
133
127
|
- lib/alpha_omega/deploy/strategy/remote.rb
|
134
128
|
- lib/alpha_omega/deploy/strategy/base.rb
|
135
129
|
- lib/alpha_omega/deploy/strategy/checkout.rb
|
130
|
+
- lib/alpha_omega/deploy/dependencies.rb
|
136
131
|
- lib/alpha_omega/deploy/templates/maintenance.rhtml
|
137
|
-
- lib/alpha_omega/deploy/local_dependency.rb
|
138
132
|
- lib/alpha_omega/deploy/scm/git.rb
|
139
133
|
- lib/alpha_omega/deploy/scm/base.rb
|
134
|
+
- lib/alpha_omega/deploy/strategy.rb
|
135
|
+
- lib/alpha_omega/deploy/local_dependency.rb
|
136
|
+
- lib/alpha_omega/deploy/remote_dependency.rb
|
137
|
+
- lib/alpha_omega/deploy/scm.rb
|
138
|
+
- lib/alpha_omega/utils.rb
|
139
|
+
- lib/alpha_omega/version.rb
|
140
|
+
- lib/alpha_omega/deploy.rb
|
140
141
|
- bin/alpha_omega
|
141
142
|
homepage: https://github.com/HeSYINUvSBZfxqA/alpha_omega
|
142
143
|
licenses: []
|