capistrano3-php5fpm 0.1.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.
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano-bundler.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Sebastian Krebs <krebs.seb@gmail.com>
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # Capistrano::php5fpm
2
+
3
+ php5-fpm support for Capistrano 3.x
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'capistrano3-php5fpm', '~> 0.1', :github => 'KingCrunch/capistrano3-php5fpm'
11
+ gem 'capistrano'
12
+ ```
13
+
14
+ And then execute:
15
+
16
+ ```bash
17
+ bundle
18
+ ```
19
+
20
+ ## Usage
21
+
22
+ Require in `Capfile` to use the default task:
23
+
24
+ ```ruby
25
+ require 'capistrano/php5fpm'
26
+ ```
27
+
28
+ You will get the following tasks
29
+
30
+ ```bash
31
+ cap php5fpm:start # Start php5-fpm service
32
+ cap php5fpm:stop # Stop php5-fpm service
33
+ cap php5fpm:reload # Reload php5-fpm service
34
+ cap php5fpm:restart # Restart php5-fpm service
35
+ cap php5fpm:pool:add # Creates the site configuration and upload it to the available folder
36
+ cap php5fpm:pool:remove # Removes the site removing the configuration file from the available folder
37
+ ```
38
+
39
+ ```ruby
40
+ # (Remote) path to php5-fpms pool folder
41
+ set :php5fpm_pool, "/etc/php5/fpm/pool.d"
42
+
43
+ # Pool configuration template
44
+ set :php5fpm_template, "#{fetch(:stage_config_path)}/#{fetch(:stage)}/php5fpm.conf.erb"
45
+ ```
@@ -0,0 +1,21 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'capistrano3-php5fpm'
7
+ spec.version = '0.1.0'
8
+ spec.authors = ['Sebastian Krebs']
9
+ spec.email = ['krebs.seb@gmail.com']
10
+ spec.description = %q{Adds suuport to php5-fpm for Capistrano 3.x}
11
+ spec.summary = %q{Adds suuport to php5-fpm for Capistrano 3.x}
12
+ spec.homepage = 'https://github.com/KingCrunch/capistrano-php5fpm'
13
+ spec.license = 'MIT'
14
+
15
+ spec.files = `git ls-files`.split($/)
16
+ spec.require_paths = ['lib']
17
+
18
+ spec.add_dependency 'capistrano', '>= 3.0.0'
19
+
20
+ spec.add_development_dependency 'rake'
21
+ end
@@ -0,0 +1 @@
1
+ load File.expand_path('../tasks/php5fpm.rake', __FILE__)
@@ -0,0 +1,43 @@
1
+ namespace :load do
2
+ task :defaults do
3
+ set :php5fpm_pool, -> { "/etc/php5/fpm/pool.d" }
4
+ set :php5fpm_template, -> { "#{fetch(:stage_config_path)}/#{fetch(:stage)}/php5fpm.conf.erb" }
5
+ end
6
+ end
7
+
8
+ namespace :php5fpm do
9
+ %w[start stop restart reload force-reload status].each do |command|
10
+ desc "#{command.capitalize} php5-fpm service"
11
+ task command do
12
+ on release_roles :app do
13
+ execute :sudo, :service, "php5-fpm", "#{command}"
14
+ end
15
+ end
16
+ end
17
+
18
+ namespace :pool do
19
+ desc 'Creates the site configuration and upload it to the available folder'
20
+ task :add do
21
+ on release_roles :app do
22
+ within fetch(:php5fpm_pool) do
23
+ config_file = fetch(:php5fpm_template)
24
+ config = ERB.new(File.read(config_file)).result(binding)
25
+ upload! StringIO.new(config), '/tmp/php5fpm.conf'
26
+
27
+ execute :sudo, :mv, '/tmp/php5fpm.conf', "#{fetch(:application)}.conf"
28
+ end
29
+ end
30
+ end
31
+
32
+ desc 'Removes the site removing the configuration file from the available folder'
33
+ task :remove do
34
+ on release_roles :app do
35
+ if test "[ -f #{fetch(:php5fpm_pool)}/#{fetch(:application)}.conf ]"
36
+ within fetch(:php5fpm_pool) do
37
+ execute :sudo, :rm, "#{fetch(:application)}.conf"
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
File without changes
metadata ADDED
@@ -0,0 +1,85 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano3-php5fpm
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Sebastian Krebs
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-04-23 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: capistrano
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 3.0.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 3.0.0
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ description: Adds suuport to php5-fpm for Capistrano 3.x
47
+ email:
48
+ - krebs.seb@gmail.com
49
+ executables: []
50
+ extensions: []
51
+ extra_rdoc_files: []
52
+ files:
53
+ - Gemfile
54
+ - LICENSE.txt
55
+ - README.md
56
+ - capistrano-php5fpm.gemspec
57
+ - lib/capistrano-php5fpm.rb
58
+ - lib/capistrano/php5fpm.rb
59
+ - lib/capistrano/tasks/php5fpm.rake
60
+ homepage: https://github.com/KingCrunch/capistrano-php5fpm
61
+ licenses:
62
+ - MIT
63
+ post_install_message:
64
+ rdoc_options: []
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ none: false
69
+ requirements:
70
+ - - ! '>='
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ! '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ requirements: []
80
+ rubyforge_project:
81
+ rubygems_version: 1.8.23
82
+ signing_key:
83
+ specification_version: 3
84
+ summary: Adds suuport to php5-fpm for Capistrano 3.x
85
+ test_files: []