capistrano-jetty 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 18db6148f4f9a0dca482e3d115ed40dab24a86da
4
- data.tar.gz: c570808dfb60925d1b1f9184ba06bf54f737cee3
3
+ metadata.gz: 596c19c36bf825e67148b4c38f2068e70c4b16d1
4
+ data.tar.gz: af4440784fa0b86026eea228974e1130e9dd5c60
5
5
  SHA512:
6
- metadata.gz: 8bd2d284a294b05f2b952b16409cc423fb3544e11fbd648029daa2eb57ee91491c10a645312f994b4ecf9419eb0379daba6a167f961f9c2ff53f4e0eb2f55888
7
- data.tar.gz: ccb123a5108f1398c804b8d8fe86b6d8fd2d8ed9d0ae0c7157a3a69334c529b9c9d666a0b90883f784f3ca0dd2f93bf9c8df53494433ba6a3412597c34410e19
6
+ metadata.gz: d9650c3e06c0aeac2e00c59b23e54a7e3b8100dac5fb03289e63d85751d9b8ca69b4b89bace4d9fe2f70fb48ffe742c11961e4d937070e46dcdf37196a24f3a0
7
+ data.tar.gz: 0b7c447b8a1c3679be6736627b69e5e504b4ef43b9348c7717ec056ed962dc25c218c065d8781e4875e418a5d981ad887872895eb4b4c4c0b7a1182feeaad184
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  This is the Changelog for Capistrano::Jetty.
4
4
 
5
+ ## v1.2.0 (2014-06-09)
6
+
7
+ * Refactor deployment to be zero-downtime courtesy of evertrue/et_haproxy-cookbook@v3.1.0
8
+
5
9
  ## v1.1.0 (2014-02-13)
6
10
 
7
11
  * Add validation to check for necessary Capistrano variables
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'capistrano-jetty'
7
- spec.version = '1.1.0'
7
+ spec.version = '1.2.0'
8
8
  spec.authors = ['Jeff Byrnes']
9
9
  spec.email = ['jeff@evertrue.com']
10
10
  spec.summary = %q{Capistrano 3 plugin for handling Jetty.}
@@ -3,8 +3,13 @@ namespace :deploy do
3
3
  on release_roles :all do
4
4
  deployed_artifact_filename = fetch(:deployed_artifact_filename)
5
5
  jetty_webapps_path = fetch(:jetty_webapps_path)
6
+ load_balancer_backend = fetch(:load_balancer_backend)
6
7
 
7
- %w(deployed_artifact_filename jetty_webapps_path).each do | var_name |
8
+ %w(
9
+ deployed_artifact_filename
10
+ jetty_webapps_path
11
+ load_balancer_backend
12
+ ).each do | var_name |
8
13
  var = eval(var_name)
9
14
 
10
15
  if var.nil?
@@ -16,22 +21,44 @@ namespace :deploy do
16
21
  end
17
22
  end
18
23
 
19
- desc 'Grab the latest artifact from the release_path'
20
- task :update_webapps do
21
- on roles(:app) do
22
- execute :cp, "#{release_path}/#{fetch(:deployed_artifact_filename)}",
24
+ desc 'Rotate servers out of HAProxy pool, stop Jetty, deploy artifact, ' \
25
+ 'restart Jetty, rotate server back into HAProxy pool'
26
+ task :rolling_restart do
27
+ on roles(:app), in: :sequence, wait: 5 do |server|
28
+ current_app_server = server.hostname
29
+
30
+ on roles(:load_balancer) do
31
+ execute(
32
+ :sudo,
33
+ '/usr/local/bin/haproxyctl',
34
+ 'disable server',
35
+ "#{fetch(:load_balancer_backend)}/#{current_app_server}"
36
+ )
37
+ end
38
+
39
+ sleep 3
40
+
41
+ execute :sudo, :service, 'jetty', 'stop'
42
+
43
+ execute(
44
+ :cp,
45
+ "#{release_path}/#{fetch(:deployed_artifact_filename)}",
23
46
  "#{fetch(:jetty_webapps_path)}/#{fetch(:deployed_artifact_filename)}"
24
- end
25
- end
47
+ )
26
48
 
27
- desc 'Restart Jetty'
28
- task :restart do
29
- on roles(:app), in: :sequence, wait: 5 do
30
- execute :sudo, :service, 'jetty', 'restart'
49
+ execute :sudo, :service, 'jetty', 'start'
50
+
51
+ on roles(:load_balancer) do
52
+ execute(
53
+ :sudo,
54
+ '/usr/local/bin/haproxyctl',
55
+ 'enable server',
56
+ "#{fetch(:load_balancer_backend)}/#{current_app_server}"
57
+ )
58
+ end
31
59
  end
32
60
  end
33
61
 
34
62
  before 'deploy:check', 'deploy:validate'
35
- before 'deploy:published', 'deploy:update_webapps'
36
- after 'deploy:published', 'deploy:restart'
63
+ after 'deploy:publishing', 'deploy:rolling_restart'
37
64
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-jetty
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Byrnes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-13 00:00:00.000000000 Z
11
+ date: 2015-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  version: '0'
92
92
  requirements: []
93
93
  rubyforge_project:
94
- rubygems_version: 2.2.2
94
+ rubygems_version: 2.4.5
95
95
  signing_key:
96
96
  specification_version: 4
97
97
  summary: Capistrano 3 plugin for handling Jetty.