alpha_omega 0.0.56 → 0.0.57
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/lib/alpha_omega/deploy.rb +2 -0
- data/lib/alpha_omega/utils.rb +36 -0
- data/lib/alpha_omega/version.rb +1 -1
- metadata +3 -3
data/lib/alpha_omega/deploy.rb
CHANGED
@@ -44,6 +44,8 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
|
|
44
44
|
_cset :bundler_options, "--deployment --without development test"
|
45
45
|
_cset :ruby_loader, ""
|
46
46
|
|
47
|
+
_cset :current_pod, "default"
|
48
|
+
|
47
49
|
_cset (:figlet) { [%x(which figlet).strip].reject {|f| !(File.executable? f)}.first || echo }
|
48
50
|
|
49
51
|
_cset :admin_hosts, /^/
|
data/lib/alpha_omega/utils.rb
CHANGED
@@ -2,6 +2,42 @@ require 'capistrano'
|
|
2
2
|
|
3
3
|
module AlphaOmega
|
4
4
|
|
5
|
+
def self.default_pods_tasks
|
6
|
+
Proc.new do |config, pod_name, pod|
|
7
|
+
# each pod task sets the pod context for host/group tasks
|
8
|
+
config.task pod_name do
|
9
|
+
set :current_pod, pod_name
|
10
|
+
end
|
11
|
+
|
12
|
+
hosts =
|
13
|
+
AlphaOmega.what_hosts pod do |task_name, remote_name, node|
|
14
|
+
config.task "#{task_name}.#{pod_name}" do
|
15
|
+
role :app, remote_name
|
16
|
+
end
|
17
|
+
|
18
|
+
config.task task_name do
|
19
|
+
after task_name, "#{task_name}.#{current_pod}"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
AlphaOmega.what_groups hosts do |task_name, nodes|
|
24
|
+
config.task "#{task_name}.#{pod_name}" do
|
25
|
+
nodes.keys.sort.each do |remote_name|
|
26
|
+
role :app, remote_name
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
config.task task_name do
|
31
|
+
after task_name, "#{task_name}.#{current_pod}"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.setup_pods (config, node_home)
|
38
|
+
self.what_pods(config, node_home) { |config, pod_name, pod| self.default_pods_tasks.call(config, pod_name, pod) }
|
39
|
+
end
|
40
|
+
|
5
41
|
def self.what_branch (allowed = %w(production master develop))
|
6
42
|
if ENV["BRANCH"]
|
7
43
|
ENV["BRANCH"]
|
data/lib/alpha_omega/version.rb
CHANGED
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: 109
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 57
|
10
|
+
version: 0.0.57
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- David Nghiem
|