alpha_omega 0.0.48 → 0.0.49

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.
@@ -1,4 +1,4 @@
1
- $:.unshift File.expand_path(File.join(File.dirname(__FILE__),'..','..','recipes'))
1
+ $:.unshift File.expand_path(File.join(File.dirname(__FILE__),'..','..','lib'))
2
2
 
3
3
  require 'benchmark'
4
4
  require 'yaml'
@@ -46,6 +46,9 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
46
46
 
47
47
  _cset (:figlet) { [%x(which figlet).strip].reject {|f| !(File.executable? f)}.first || echo }
48
48
 
49
+ _cset :admin_hosts, /^/
50
+ _cset :gateway_host, "localhost"
51
+
49
52
  # =========================================================================
50
53
  # These variables should NOT be changed unless you are very confident in
51
54
  # what you are doing. Make sure you understand all the implications of your
@@ -72,21 +75,25 @@ Capistrano::Configuration.instance(:must_exist).load do |config|
72
75
 
73
76
  _cset(:current_release) { release_path }
74
77
  _cset(:current_workarea) { capture("readlink #{current_path} || true").strip.split("/")[-1] }
75
- _cset(:previous_release) { if releases.length > 0
76
- w = current_workarea
77
- releases.index(w) && releases[(releases.index(w)-1)%releases.length] || nil
78
- else
79
- ""
80
- end
78
+
79
+ _cset(:previous_release) {
80
+ if releases.length > 0
81
+ w = current_workarea
82
+ releases.index(w) && releases[(releases.index(w)-1)%releases.length] || nil
83
+ else
84
+ ""
85
+ end
81
86
  }
82
- _cset(:release_name) { if releases.length > 0
83
- w = current_workarea
84
- stage = releases[((releases.index(w)?releases.index(w):-1)+1)%releases.length]
85
- system "#{figlet} -w 200 on #{stage}"
86
- stage
87
- else
88
- ""
89
- end
87
+
88
+ _cset(:release_name) {
89
+ if releases.length > 0
90
+ w = current_workarea
91
+ stage = releases[((releases.index(w)?releases.index(w):-1)+1)%releases.length]
92
+ system "#{figlet} -w 200 on #{stage}"
93
+ stage
94
+ else
95
+ ""
96
+ end
90
97
  }
91
98
 
92
99
  _cset(:current_revision) { capture("cat #{current_path}/REVISION", :except => { :no_release => true }).chomp }
@@ -545,6 +552,18 @@ end
545
552
  end
546
553
  end
547
554
 
555
+ task :no_gateway do
556
+ unset :gateway
557
+ end
558
+
559
+ task :ssh_gateway do
560
+ # set gateway on non-admin servers, defaulting to the developer admin host
561
+ if ENV["GATEWAY"] || !admin_hosts.match(Socket.gethostname)
562
+ ssh_options[:forward_agent] = true
563
+ set :gateway, ENV["GATEWAY"] ? ENV["GATEWAY"] : gateway_host
564
+ end
565
+ end
566
+
548
567
  on :exit do
549
568
  put full_log, "#{log_path}/#{application}_last_deploy-#{release_name}-#{branch.gsub(/\W+/,"_")}.log-#{Time.now.strftime('%Y%m%d-%H%M')}"
550
569
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,3 +1,3 @@
1
1
  module AlphaOmega
2
- Version = "0.0.48"
2
+ Version = "0.0.49"
3
3
  end
data/libexec/compare CHANGED
@@ -1,8 +1,4 @@
1
1
  #!/bin/bash -e
2
2
 
3
3
  bundle check || { bundle --local --path vendor/bundle && bundle check; }
4
- if [[ -z $1 ]]; then
5
- exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1
6
- else
7
- exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1 --args "$@"
8
- fi
4
+ exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1 --args ssh_gateway "$@"
data/libexec/deploy CHANGED
@@ -1,8 +1,4 @@
1
1
  #!/bin/bash -e
2
2
 
3
3
  bundle check || { bundle --local --path vendor/bundle && bundle check; }
4
- if [[ -z $1 ]]; then
5
- exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1
6
- else
7
- exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1 --args "$@"
8
- fi
4
+ exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1 --args ssh_gateway "$@"
data/libexec/major CHANGED
@@ -1,8 +1,4 @@
1
1
  #!/bin/bash -e
2
2
 
3
3
  bundle check || { bundle --local --path vendor/bundle && bundle check; }
4
- if [[ -z $1 ]]; then
5
- exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1
6
- else
7
- exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1 --args "$@"
8
- fi
4
+ exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1 --args ssh_gateway "$@"
data/libexec/patch CHANGED
@@ -1,8 +1,4 @@
1
1
  #!/bin/bash -e
2
2
 
3
3
  bundle check || { bundle --local --path vendor/bundle && bundle check; }
4
- if [[ -z $1 ]]; then
5
- exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1
6
- else
7
- exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1 --args "$@"
8
- fi
4
+ exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1 --args ssh_gateway "$@"
data/libexec/rollback CHANGED
@@ -1,8 +1,4 @@
1
1
  #!/bin/bash -e
2
2
 
3
3
  bundle check || { bundle --local --path vendor/bundle && bundle check; }
4
- if [[ -z $1 ]]; then
5
- exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1
6
- else
7
- exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1 --args "$@"
8
- fi
4
+ exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1 --args ssh_gateway "$@"
data/libexec/shell CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/bin/bash -e
2
2
 
3
3
  bundle check || { bundle --local --path vendor/bundle && bundle check; }
4
- exec bundle exec cap "$@" shell
4
+ exec bundle exec cap ssh_gateway "$@" shell
data/libexec/stage CHANGED
@@ -1,8 +1,4 @@
1
1
  #!/bin/bash -e
2
2
 
3
3
  bundle check || { bundle --local --path vendor/bundle && bundle check; }
4
- if [[ -z $1 ]]; then
5
- exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1
6
- else
7
- exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1 --args "$@"
8
- fi
4
+ exec bundle exec foreman start -f $(dirname $(dirname $0))/Procfile.rb -m 0 -c git=0,$(basename $0)=1 --args ssh_gateway "$@"
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: 127
4
+ hash: 125
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 48
10
- version: 0.0.48
9
+ - 49
10
+ version: 0.0.49
11
11
  platform: ruby
12
12
  authors:
13
13
  - David Nghiem
@@ -109,20 +109,20 @@ files:
109
109
  - libexec/rollback
110
110
  - libexec/shell
111
111
  - libexec/stage
112
- - recipes/alpha_omega/deploy/dependencies.rb
113
- - recipes/alpha_omega/deploy/local_dependency.rb
114
- - recipes/alpha_omega/deploy/remote_dependency.rb
115
- - recipes/alpha_omega/deploy/scm/base.rb
116
- - recipes/alpha_omega/deploy/scm/git.rb
117
- - recipes/alpha_omega/deploy/scm.rb
118
- - recipes/alpha_omega/deploy/strategy/base.rb
119
- - recipes/alpha_omega/deploy/strategy/checkout.rb
120
- - recipes/alpha_omega/deploy/strategy/remote.rb
121
- - recipes/alpha_omega/deploy/strategy.rb
122
- - recipes/alpha_omega/deploy/templates/maintenance.rhtml
123
- - recipes/alpha_omega/deploy.rb
124
- - recipes/alpha_omega/utils.rb
125
- - recipes/alpha_omega/version.rb
112
+ - lib/alpha_omega/deploy/dependencies.rb
113
+ - lib/alpha_omega/deploy/local_dependency.rb
114
+ - lib/alpha_omega/deploy/remote_dependency.rb
115
+ - lib/alpha_omega/deploy/scm/base.rb
116
+ - lib/alpha_omega/deploy/scm/git.rb
117
+ - lib/alpha_omega/deploy/scm.rb
118
+ - lib/alpha_omega/deploy/strategy/base.rb
119
+ - lib/alpha_omega/deploy/strategy/checkout.rb
120
+ - lib/alpha_omega/deploy/strategy/remote.rb
121
+ - lib/alpha_omega/deploy/strategy.rb
122
+ - lib/alpha_omega/deploy/templates/maintenance.rhtml
123
+ - lib/alpha_omega/deploy.rb
124
+ - lib/alpha_omega/utils.rb
125
+ - lib/alpha_omega/version.rb
126
126
  - bin/deploy
127
127
  homepage: https://github.com/HeSYINUvSBZfxqA/alpha_omega
128
128
  licenses: []
@@ -131,7 +131,7 @@ post_install_message:
131
131
  rdoc_options: []
132
132
 
133
133
  require_paths:
134
- - recipes
134
+ - lib
135
135
  required_ruby_version: !ruby/object:Gem::Requirement
136
136
  none: false
137
137
  requirements: