capistrano-jetty 1.2.1 → 2.0.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -10
- data/capistrano-jetty.gemspec +1 -1
- data/lib/capistrano-jetty/tasks/jetty.rake +1 -26
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b044b2c55e0f2fd99941b44aedcb5cd4d1e5dea5
|
4
|
+
data.tar.gz: b4674156cae9bf0516cf00630f038c856187c85e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e875e0f0607bdc723306fa8c778584c3ca407db22614d5d2c578c500785066082a7aeb43323021c5260190c54dc931ec6f0aabae7643bc35a7c673504affaba5
|
7
|
+
data.tar.gz: 064b0f8a9b8e7ca254348d287f22e5e7acdaa4a5a6eacb8dd55547a1e0e3d0db6994b83f3da7a4de2c543931cf9b6630926cacf2089f4fee812210c01856ee12
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -27,6 +27,7 @@ This Gem requires that your deploy user have *passwordless sudo rights* to run
|
|
27
27
|
for a simple example.
|
28
28
|
|
29
29
|
In `Capfile`:
|
30
|
+
|
30
31
|
```ruby
|
31
32
|
require 'capistrano-jetty/jetty'
|
32
33
|
```
|
@@ -41,16 +42,6 @@ set :deployed_artifact_filename, "#{fetch(:application)}.war"
|
|
41
42
|
set :jetty_webapps_path, '/usr/share/jetty/webapps'
|
42
43
|
```
|
43
44
|
|
44
|
-
In your `config/deploy/(staging|production).rb`, specify the hostname of the HAProxy server(s) and the name of the HAProxy backend for your servers:
|
45
|
-
|
46
|
-
```ruby
|
47
|
-
server 'prod-api-haproxy-1d', user: fetch(:user), roles: %w{load_balancer}, no_release: true
|
48
|
-
|
49
|
-
set :load_balancer_backend, 'contactsapi-prod'
|
50
|
-
```
|
51
|
-
|
52
|
-
See the [Chef stage environment](https://github.com/evertrue/server-chef/blob/master/environments/stage.json#L141) and [Chef prod environment](https://github.com/evertrue/server-chef/blob/master/environments/prod.json#L232) to find your app’s HAProxy backend. Line numbers may change; search for `backends` in case these links out-of-date.
|
53
|
-
|
54
45
|
## Contributing
|
55
46
|
|
56
47
|
1. Fork it ( http://github.com/evertrue/capistrano-jetty/fork )
|
data/capistrano-jetty.gemspec
CHANGED
@@ -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 = '
|
7
|
+
spec.version = '2.0.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,12 +3,10 @@ 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)
|
7
6
|
|
8
7
|
%w(
|
9
8
|
deployed_artifact_filename
|
10
9
|
jetty_webapps_path
|
11
|
-
load_balancer_backend
|
12
10
|
).each do | var_name |
|
13
11
|
var = eval(var_name)
|
14
12
|
|
@@ -21,23 +19,9 @@ namespace :deploy do
|
|
21
19
|
end
|
22
20
|
end
|
23
21
|
|
24
|
-
desc '
|
25
|
-
'restart Jetty, rotate server back into HAProxy pool'
|
22
|
+
desc 'Stop Jetty, deploy artifact, start Jetty'
|
26
23
|
task :rolling_restart do
|
27
24
|
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
25
|
execute :sudo, :service, 'jetty', 'stop'
|
42
26
|
|
43
27
|
execute(
|
@@ -47,15 +31,6 @@ namespace :deploy do
|
|
47
31
|
)
|
48
32
|
|
49
33
|
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
|
59
34
|
end
|
60
35
|
end
|
61
36
|
|