capistrano-passenger 0.0.5 → 0.1.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: de7f72b6bfcdc40bbbd10af5c56e00ba964a56b0
4
- data.tar.gz: bc39916c2642aa4126fc48b1df4bc1571391066c
3
+ metadata.gz: b5ee8db6f8a9beab517c5f1eaa2faba15e74be5d
4
+ data.tar.gz: 2ba0636361cc9de6032b09e636bcd91c404dac91
5
5
  SHA512:
6
- metadata.gz: 8d6135fa823c59892880fd81721df36ffde57b6001bb4b583d1cc901bea290bea5b7d3b48421b3a171b699c4f2138d266d4c5f9dd713040d0861ee7540a16af3
7
- data.tar.gz: 16559f6fa7ab2e0dea172615dc49b891ede80016051ea936f9b9c4ca267fdf3cbe8691bdb46a7a872b70af4f581be656421374d22d025aea0e8a8d84ffffc0ba
6
+ metadata.gz: 76c961c0c17ce58ba826ce79662a2fcb5500141d54aeb2cd18a2cf6903ed50c25f3bf263009c5807d16aefd223b8efbb1c5fa53b4ae3bfdc2569ae9e8741a47d
7
+ data.tar.gz: ff7bdc114ffef5d3f91726b860c04e0c12c370ff0864d5f838a700435a042fd3c677f4780bd14ab307c0dd8d82c8b4e5fd72f8591e63b290fbeea5551f5b75f9
@@ -1,3 +1,11 @@
1
+ # 0.1.0 (3 June 2015)
2
+
3
+ * BREAKING CHANGES
4
+ * On version of passenger that support both restarting by touch and restarting with passenger-config, the default is to use passenger-config. set :passenger_restart_with_touch to true to opt out of this.
5
+ * Bug fixes:
6
+ * Restored support for CHRuby (@aeons, capistrano/passenger#16)
7
+ * Restored support for passenger installed by bundle (@betesh, capistrano/passenger#10)
8
+
1
9
  # 0.0.5 (12 Apr 2015)
2
10
 
3
11
  * Bug fixes:
data/README.md CHANGED
@@ -89,13 +89,19 @@ set :passenger_environment_variables, { :path => '/your/path/to/passenger/bin:$P
89
89
 
90
90
  https://www.phusionpassenger.com/documentation/Users%20guide%20Apache.html#_when_the_system_has_multiple_ruby_interpreters descibes how "Once installed, you can run Phusion Passenger’s Ruby parts under any Ruby interpreter you want, even if that Ruby interpreter was not the one you originally installed Phusion Passenger with. [...] There is however one caveat if you happen to be using RVM or RVM gemsets. When you gem install Phusion Passenger using RVM," it is available only to the Ruby version where it was installed. Therefore, if you are using RVM **AND** passenger was installed via RVM **AND** it was installed under a different version of RVM than `fetch(:rvm_ruby_version)`, you need to `set :passenger_rvm_ruby_version` in your `config/deploy.rb`.
91
91
 
92
- ### Restarting Passenger 5 (and above) Applications
92
+ ### Note for Standalone Passenger users
93
93
 
94
- Passenger 5 introduced a new way to restart your application, and thus has some additional configuration options to accomodate for various server environments.
94
+ If you are running passenger in standalone mode, it is possible for you to put passenger in your Gemfile and rely on capistrano-bundler to install it with the rest of your bundle. If you are installing passenger during your deployment **AND** you are using the new restart method (see below), you need to set `:passenger_in_gemfile` to `true` in your `config/deploy.rb`.
95
+
96
+ ### Restarting Passenger >= 4.0.33 Applications
97
+
98
+ Passenger 4.0.33 introduced a new way to restart your application, and thus has some additional configuration options to accomodate for various server environments.
95
99
 
96
100
  If you need to pass additional/different options to `:passenger_restart_command`, simply override `:passenger_restart_options`.
97
101
 
98
- If you require `sudo` when restarting passenger, set `:passenger_restart_with_sudo` to `true`. **Note**: This option has no effect when restarting Passenger 4 (and lower) applications.
102
+ If you require `sudo` when restarting passenger, set `:passenger_restart_with_sudo` to `true`. **Note**: This option has no effect when restarting Passenger <= 4.0.32 applications.
103
+
104
+ To opt out of the new way to restart, and use the deprecated approach instead, set `:passenger_restart_with_touch` to `true`.
99
105
 
100
106
  ## Contributing
101
107
 
@@ -21,4 +21,32 @@ Gem::Specification.new do |spec|
21
21
  spec.add_dependency "capistrano", "~> 3.0"
22
22
  spec.add_development_dependency "bundler", "~> 1.6"
23
23
  spec.add_development_dependency "rake"
24
+ spec.post_install_message = <<PIM
25
+ ==== Release notes for capistrano-passenger ====
26
+ passenger once had only one way to restart: `touch tmp/restart.txt`
27
+ Beginning with passenger v4.0.33, a new way was introduced: `passenger-config restart-app`
28
+
29
+ The new way to restart is not so practical for everyone, since it may require your deployment user to have sudo access.
30
+ While we eagerly await the release of passenger v5.0.10, which will make the new method possible without sudo access,
31
+ we recognize that not everyone is ready for this change yet.
32
+
33
+ capistrano-passenger gives you the flexibility to choose your restart approach, or to rely on reasonable defaults.
34
+
35
+ If you want to restart using `touch tmp/restart.txt`, add this to your config/deploy.rb:
36
+
37
+ set :passenger_restart_with_touch, true
38
+
39
+ If you want to restart using `passenger-config restart-app`, add this to your config/deploy.rb:
40
+
41
+ set :passenger_restart_with_touch, false # Note that `nil` is NOT the same as `false` here
42
+
43
+ If you don't set `:passenger_restart_with_touch`, capistrano-passenger will check what version of passenger you are running
44
+ and use `passenger-config restart-app` if it is available in that version.
45
+
46
+ If you are running passenger in standalone mode, it is possible for you to put passenger in your
47
+ Gemfile and rely on capistrano-bundler to install it with the rest of your bundle.
48
+ If you are installing passenger during your deployment AND you want to restart using `passenger-config restart-app`,
49
+ you need to set `:passenger_in_gemfile` to `true` in your `config/deploy.rb`.
50
+ ================================================
51
+ PIM
24
52
  end
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Passenger
3
- VERSION = "0.0.5"
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
@@ -5,5 +5,5 @@ namespace :deploy do
5
5
  task :restart do
6
6
  invoke('passenger:restart')
7
7
  end
8
- after :publishing, :restart
8
+ after :publishing, :'deploy:restart'
9
9
  end
@@ -1,29 +1,43 @@
1
1
  namespace :passenger do
2
2
  desc 'Restart your Passenger application'
3
3
  task :restart do
4
+ restart_with_touch = fetch(:passenger_restart_with_touch, nil)
5
+ if restart_with_touch.nil? && fetch(:sshkit_backend) == SSHKit::Backend::Printer
6
+ run_locally do
7
+ fatal "In a dry run, we cannot check the passenger version, and therefore can't guess which passenger restart method to use. Therefore, using --dry-run without setting `passenger_restart_with_touch` to either `true` or `false` is not supported."
8
+ end
9
+ exit
10
+ end
4
11
  on roles(fetch(:passenger_roles)), in: fetch(:passenger_restart_runner), wait: fetch(:passenger_restart_wait), limit: fetch(:passenger_restart_limit) do
5
12
  with fetch(:passenger_environment_variables) do
6
- passenger_version = capture(:passenger, '-v').match(/\APhusion Passenger version (.*)$/)[1].to_i
13
+ within(release_path) do
14
+ if restart_with_touch.nil?
15
+ passenger_version = capture(:passenger, '-v').match(/\APhusion Passenger version (.*)$/)[1]
16
+ restart_with_touch = Gem::Version.new(passenger_version) < Gem::Version.new('4.0.33')
17
+ end
7
18
 
8
- if passenger_version > 4
9
- restart_with_sudo = fetch(:passenger_restart_with_sudo) ? :sudo : nil
10
- arguments = [restart_with_sudo, *fetch(:passenger_restart_command).split(" ").collect(&:to_sym), fetch(:passenger_restart_options)].compact
11
- execute *arguments
12
- else
13
- execute :mkdir, '-p', release_path.join('tmp')
14
- execute :touch, release_path.join('tmp/restart.txt')
19
+ if restart_with_touch
20
+ execute :mkdir, '-p', release_path.join('tmp')
21
+ execute :touch, release_path.join('tmp/restart.txt')
22
+ else
23
+ restart_with_sudo = fetch(:passenger_restart_with_sudo) ? :sudo : nil
24
+ arguments = SSHKit::Command.new(*[*fetch(:passenger_restart_command).split(" ").collect(&:to_sym), fetch(:passenger_restart_options)]).to_s
25
+ execute *[restart_with_sudo, arguments].compact
26
+ end
15
27
  end
16
28
  end
17
29
  end
18
30
  end
19
31
 
32
+ task :test_which_passenger do
33
+ on roles(fetch(:passenger_roles)) do
34
+ set(:passenger_in_path, test(:which, :passenger))
35
+ end
36
+ end
37
+
20
38
  namespace :rvm do
21
- task :hook do
22
- passenger_installed_via_rvm = false
23
- on roles(fetch(:passenger_roles)) do
24
- passenger_installed_via_rvm = !(test :which, :passenger)
25
- end
26
- if passenger_installed_via_rvm
39
+ task hook: :"passenger:test_which_passenger" do
40
+ unless fetch(:passenger_in_path)
27
41
  if fetch(:passenger_rvm_ruby_version) == fetch(:rvm_ruby_version)
28
42
  set :rvm_map_bins, fetch(:rvm_map_bins) + [:passenger, :'passenger-config']
29
43
  else
@@ -42,13 +56,24 @@ namespace :passenger do
42
56
  end
43
57
 
44
58
  namespace :rbenv do
59
+ task hook: :"passenger:test_which_passenger" do
60
+ set :rbenv_map_bins, fetch(:rbenv_map_bins) + [:passenger, :'passenger-config'] unless fetch(:passenger_in_path)
61
+ end
62
+ end
63
+
64
+ namespace :chruby do
65
+ task hook: :"passenger:test_which_passenger" do
66
+ set :chruby_map_bins, fetch(:chruby_map_bins) + [:passenger, :'passenger-config'] unless fetch(:passenger_in_path)
67
+ end
68
+ end
69
+
70
+ namespace :bundler do
45
71
  task :hook do
46
- set :rbenv_map_bins, fetch(:rbenv_map_bins) + [:passenger, :'passenger-config']
72
+ set :bundle_bins, fetch(:bundle_bins) + [:passenger, :'passenger-config'] if fetch(:passenger_in_gemfile, false)
47
73
  end
48
74
  end
49
75
  end
50
76
 
51
-
52
77
  namespace :load do
53
78
  task :defaults do
54
79
  set :passenger_roles, :app
@@ -60,11 +85,16 @@ namespace :load do
60
85
  set :passenger_restart_command, 'passenger-config restart-app'
61
86
  set :passenger_restart_options, -> { "#{deploy_to} --ignore-app-not-running" }
62
87
  set :passenger_rvm_ruby_version, ->{ fetch(:rvm_ruby_version) }
63
- if Rake.application.tasks.collect(&:to_s).include?("rvm:hook")
64
- before :'rvm:hook', :'passenger:rvm:hook'
88
+ _tasks = Rake.application.tasks.collect(&:to_s)
89
+ if _tasks.include?("bundler:map_bins")
90
+ before :'bundler:map_bins', :'passenger:bundler:hook'
65
91
  end
66
- if Rake.application.tasks.collect(&:to_s).include?("rbenv:map_bins")
92
+ if _tasks.include?("rvm:hook")
93
+ before :'rvm:hook', :'passenger:rvm:hook'
94
+ elsif _tasks.include?("rbenv:map_bins")
67
95
  before :'rbenv:map_bins', :'passenger:rbenv:hook'
96
+ elsif _tasks.include?("chruby:map_bins")
97
+ before :'chruby:map_bins', :'passenger:chruby:hook'
68
98
  end
69
99
  end
70
100
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-passenger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Isaac Betesh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-12 00:00:00.000000000 Z
11
+ date: 2015-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -76,7 +76,33 @@ homepage: https://github.com/capistrano/passenger
76
76
  licenses:
77
77
  - MIT
78
78
  metadata: {}
79
- post_install_message:
79
+ post_install_message: |
80
+ ==== Release notes for capistrano-passenger ====
81
+ passenger once had only one way to restart: `touch tmp/restart.txt`
82
+ Beginning with passenger v4.0.33, a new way was introduced: `passenger-config restart-app`
83
+
84
+ The new way to restart is not so practical for everyone, since it may require your deployment user to have sudo access.
85
+ While we eagerly await the release of passenger v5.0.10, which will make the new method possible without sudo access,
86
+ we recognize that not everyone is ready for this change yet.
87
+
88
+ capistrano-passenger gives you the flexibility to choose your restart approach, or to rely on reasonable defaults.
89
+
90
+ If you want to restart using `touch tmp/restart.txt`, add this to your config/deploy.rb:
91
+
92
+ set :passenger_restart_with_touch, true
93
+
94
+ If you want to restart using `passenger-config restart-app`, add this to your config/deploy.rb:
95
+
96
+ set :passenger_restart_with_touch, false # Note that `nil` is NOT the same as `false` here
97
+
98
+ If you don't set `:passenger_restart_with_touch`, capistrano-passenger will check what version of passenger you are running
99
+ and use `passenger-config restart-app` if it is available in that version.
100
+
101
+ If you are running passenger in standalone mode, it is possible for you to put passenger in your
102
+ Gemfile and rely on capistrano-bundler to install it with the rest of your bundle.
103
+ If you are installing passenger during your deployment AND you want to restart using `passenger-config restart-app`,
104
+ you need to set `:passenger_in_gemfile` to `true` in your `config/deploy.rb`.
105
+ ================================================
80
106
  rdoc_options: []
81
107
  require_paths:
82
108
  - lib
@@ -92,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
118
  version: '0'
93
119
  requirements: []
94
120
  rubyforge_project:
95
- rubygems_version: 2.2.2
121
+ rubygems_version: 2.4.3
96
122
  signing_key:
97
123
  specification_version: 4
98
124
  summary: Passenger support for Capistrano 3.x