alpha_omega 0.0.18 → 0.0.23
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/libexec/compare +2 -2
- data/libexec/deploy +2 -2
- data/libexec/major +2 -2
- data/libexec/patch +2 -2
- data/libexec/rollback +2 -2
- data/libexec/stage +2 -2
- data/recipes/alpha_omega/deploy.rb +9 -1
- data/recipes/alpha_omega/utils.rb +72 -0
- data/recipes/alpha_omega/version.rb +1 -1
- metadata +24 -23
data/Gemfile.lock
CHANGED
data/libexec/compare
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
which figlet 2>&- > /dev/null
|
4
4
|
bundle check || { bundle --local --path vendor/bundle && bundle check; }
|
5
5
|
if [[ -z $1 ]]; then
|
6
|
-
exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=
|
6
|
+
exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1
|
7
7
|
else
|
8
|
-
exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=
|
8
|
+
exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1 --args "$@"
|
9
9
|
fi
|
data/libexec/deploy
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
which figlet 2>&- > /dev/null
|
4
4
|
bundle check || { bundle --local --path vendor/bundle && bundle check; }
|
5
5
|
if [[ -z $1 ]]; then
|
6
|
-
exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=
|
6
|
+
exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1
|
7
7
|
else
|
8
|
-
exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=
|
8
|
+
exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1 --args "$@"
|
9
9
|
fi
|
data/libexec/major
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
which figlet 2>&- > /dev/null
|
4
4
|
bundle check || { bundle --local --path vendor/bundle && bundle check; }
|
5
5
|
if [[ -z $1 ]]; then
|
6
|
-
exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=
|
6
|
+
exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1
|
7
7
|
else
|
8
|
-
exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=
|
8
|
+
exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1 --args "$@"
|
9
9
|
fi
|
data/libexec/patch
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
which figlet 2>&- > /dev/null
|
4
4
|
bundle check || { bundle --local --path vendor/bundle && bundle check; }
|
5
5
|
if [[ -z $1 ]]; then
|
6
|
-
exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=
|
6
|
+
exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1
|
7
7
|
else
|
8
|
-
exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=
|
8
|
+
exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1 --args "$@"
|
9
9
|
fi
|
data/libexec/rollback
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
which figlet 2>&- > /dev/null
|
4
4
|
bundle check || { bundle --local --path vendor/bundle && bundle check; }
|
5
5
|
if [[ -z $1 ]]; then
|
6
|
-
exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=
|
6
|
+
exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1
|
7
7
|
else
|
8
|
-
exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=
|
8
|
+
exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1 --args "$@"
|
9
9
|
fi
|
data/libexec/stage
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
which figlet 2>&- > /dev/null
|
4
4
|
bundle check || { bundle --local --path vendor/bundle && bundle check; }
|
5
5
|
if [[ -z $1 ]]; then
|
6
|
-
exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=
|
6
|
+
exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1
|
7
7
|
else
|
8
|
-
exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=
|
8
|
+
exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1 --args "$@"
|
9
9
|
fi
|
@@ -4,6 +4,7 @@ require 'benchmark'
|
|
4
4
|
require 'yaml'
|
5
5
|
require 'alpha_omega/deploy/scm'
|
6
6
|
require 'alpha_omega/deploy/strategy'
|
7
|
+
require 'alpha_omega/utils'
|
7
8
|
require 'capistrano_colors'
|
8
9
|
require 'capistrano/log_with_awesome'
|
9
10
|
|
@@ -280,6 +281,13 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
|
|
280
281
|
task :restart, :roles => :app, :except => { :no_release => true } do
|
281
282
|
end
|
282
283
|
|
284
|
+
desc <<-DESC
|
285
|
+
Compares your application.
|
286
|
+
DESC
|
287
|
+
task :compare, :roles => :app, :except => { :no_release => true } do
|
288
|
+
update_code
|
289
|
+
end
|
290
|
+
|
283
291
|
namespace :rollback do
|
284
292
|
desc <<-DESC
|
285
293
|
[internal] Points the current symlink at the previous revision.
|
@@ -466,7 +474,7 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
|
|
466
474
|
set -e; cd #{release_path};
|
467
475
|
[[ -f #{ruby_env} ]] && . #{ruby_env};
|
468
476
|
[[ -f #{ruby_rvm} ]] && { set +e; source #{ruby_rvm}; set -e; };
|
469
|
-
bundle check || bundle install --deployment --quiet --local --without development test
|
477
|
+
bundle check || { bundle install --deployment --quiet --local --without development test && bundle check; };
|
470
478
|
SCRIPT
|
471
479
|
run run_script.gsub(/[\n\r]+[ \t]+/, " ")
|
472
480
|
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require 'capistrano'
|
2
|
+
|
3
|
+
module AlphaOmega
|
4
|
+
|
5
|
+
def self.what_branch (allowed = %w(production master develop))
|
6
|
+
if ENV["BRANCH"]
|
7
|
+
ENV["BRANCH"]
|
8
|
+
elsif ENV["TAG"]
|
9
|
+
ENV["TAG"]
|
10
|
+
else
|
11
|
+
current = `git branch`.split("\n").find {|b| b.split(" ")[0] == '*' } # use Grit
|
12
|
+
if current
|
13
|
+
star, branch_name = current.split(" ")
|
14
|
+
branch_type, branch_feature = branch_name.split("/")
|
15
|
+
if %w(feature hotfix).member?(branch_type)
|
16
|
+
branch_name
|
17
|
+
elsif !branch_feature && allowed.member?(branch_type)
|
18
|
+
branch_type
|
19
|
+
else
|
20
|
+
puts "current branch must be #{allowed.join(', ')}, feature/xyz, or hotfix/xyz"
|
21
|
+
abort
|
22
|
+
end
|
23
|
+
else
|
24
|
+
puts "could not find a suitable branch"
|
25
|
+
abort
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.what_hosts (nodes_spec)
|
31
|
+
# load all the nodes and define cap tasks
|
32
|
+
nodes = {}
|
33
|
+
|
34
|
+
Dir[nodes_spec].each do |fname|
|
35
|
+
nm_node = File.basename(fname, ".json")
|
36
|
+
|
37
|
+
node = JSON.parse(IO.read(fname))
|
38
|
+
node[:node_name] = nm_node
|
39
|
+
|
40
|
+
nodes[nm_node] = node
|
41
|
+
|
42
|
+
yield node if node[:node_name] && node["public_ip"] # TODO is the :node_name test necessary?
|
43
|
+
end
|
44
|
+
|
45
|
+
nodes
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.what_groups (nodes)
|
50
|
+
# generalize groups
|
51
|
+
cap_groups = {}
|
52
|
+
|
53
|
+
nodes.each do |nm_node, node|
|
54
|
+
%w(chef_group cap_group).each do |nm_group| # TODO get rid of chef_group
|
55
|
+
if node.member?(nm_group) && !node["ignore"]
|
56
|
+
node[nm_group].each do |g|
|
57
|
+
cap_groups[g] ||= {}
|
58
|
+
cap_groups[g][nm_node] = node
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
cap_groups.each do |nm_group, group|
|
65
|
+
yield nm_group, group
|
66
|
+
end
|
67
|
+
|
68
|
+
cap_groups
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
72
|
+
|
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: 49
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 23
|
10
|
+
version: 0.0.23
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- David Nghiem
|
@@ -20,9 +20,7 @@ date: 2011-08-31 00:00:00 +00:00
|
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
|
-
|
24
|
-
prerelease: false
|
25
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
23
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
26
24
|
none: false
|
27
25
|
requirements:
|
28
26
|
- - ">="
|
@@ -31,12 +29,12 @@ dependencies:
|
|
31
29
|
segments:
|
32
30
|
- 0
|
33
31
|
version: "0"
|
32
|
+
prerelease: false
|
34
33
|
type: :runtime
|
35
|
-
|
34
|
+
requirement: *id001
|
35
|
+
name: grit
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
|
-
|
38
|
-
prerelease: false
|
39
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
37
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
40
38
|
none: false
|
41
39
|
requirements:
|
42
40
|
- - ">="
|
@@ -45,12 +43,12 @@ dependencies:
|
|
45
43
|
segments:
|
46
44
|
- 0
|
47
45
|
version: "0"
|
46
|
+
prerelease: false
|
48
47
|
type: :runtime
|
49
|
-
|
48
|
+
requirement: *id002
|
49
|
+
name: HeSYINUvSBZfxqA-foreman
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
|
-
|
52
|
-
prerelease: false
|
53
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
51
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
54
52
|
none: false
|
55
53
|
requirements:
|
56
54
|
- - ">="
|
@@ -59,12 +57,12 @@ dependencies:
|
|
59
57
|
segments:
|
60
58
|
- 0
|
61
59
|
version: "0"
|
60
|
+
prerelease: false
|
62
61
|
type: :runtime
|
63
|
-
|
62
|
+
requirement: *id003
|
63
|
+
name: HeSYINUvSBZfxqA-capistrano
|
64
64
|
- !ruby/object:Gem::Dependency
|
65
|
-
|
66
|
-
prerelease: false
|
67
|
-
requirement: &id004 !ruby/object:Gem::Requirement
|
65
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
68
66
|
none: false
|
69
67
|
requirements:
|
70
68
|
- - ">="
|
@@ -73,12 +71,12 @@ dependencies:
|
|
73
71
|
segments:
|
74
72
|
- 0
|
75
73
|
version: "0"
|
74
|
+
prerelease: false
|
76
75
|
type: :runtime
|
77
|
-
|
76
|
+
requirement: *id004
|
77
|
+
name: HeSYINUvSBZfxqA-capistrano_colors
|
78
78
|
- !ruby/object:Gem::Dependency
|
79
|
-
|
80
|
-
prerelease: false
|
81
|
-
requirement: &id005 !ruby/object:Gem::Requirement
|
79
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
82
80
|
none: false
|
83
81
|
requirements:
|
84
82
|
- - ">="
|
@@ -87,8 +85,10 @@ dependencies:
|
|
87
85
|
segments:
|
88
86
|
- 0
|
89
87
|
version: "0"
|
88
|
+
prerelease: false
|
90
89
|
type: :runtime
|
91
|
-
|
90
|
+
requirement: *id005
|
91
|
+
name: HeSYINUvSBZfxqA-capistrano_log
|
92
92
|
description: Common reciples for persistent capistrano releases
|
93
93
|
email:
|
94
94
|
- nghidav@gmail.com
|
@@ -128,6 +128,7 @@ files:
|
|
128
128
|
- recipes/alpha_omega/deploy/strategy/checkout.rb
|
129
129
|
- recipes/alpha_omega/deploy/strategy/remote.rb
|
130
130
|
- recipes/alpha_omega/deploy/templates/maintenance.rhtml
|
131
|
+
- recipes/alpha_omega/utils.rb
|
131
132
|
- recipes/alpha_omega/version.rb
|
132
133
|
- vendor/cache/HeSYINUvSBZfxqA-capistrano-2.5.21.gem
|
133
134
|
- vendor/cache/HeSYINUvSBZfxqA-capistrano_colors-0.5.5.gem
|