capistrano-apache 1.0.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +4 -0
- data/CHANGELOG.md +2 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +36 -0
- data/LICENSE +21 -0
- data/README.md +77 -0
- data/Rakefile +1 -0
- data/capistrano-apache.gemspec +21 -0
- data/lib/capistrano/apache/apache.rake +6 -0
- data/lib/capistrano/apache/systemd/apache2.rb +2 -0
- data/lib/capistrano/apache/systemd/httpd.rb +2 -0
- data/lib/capistrano/apache/systemd/tasks/apache2.rake +41 -0
- data/lib/capistrano/apache/systemd/tasks/httpd.rake +41 -0
- data/lib/capistrano/apache/sysv_upstart/apache2.rb +2 -0
- data/lib/capistrano/apache/sysv_upstart/httpd.rb +2 -0
- data/lib/capistrano/apache/sysv_upstart/tasks/apache2.rake +39 -0
- data/lib/capistrano/{tasks/apache.rake → apache/sysv_upstart/tasks/httpd.rake} +9 -14
- data/lib/capistrano/apache/version.rb +5 -0
- metadata +25 -8
- data/lib/capistrano/apache.rb +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f375849f1c1737c5216bf52f2bc11f9d7e9fbb734a70501e7c8c63eb8cd8ef13
|
4
|
+
data.tar.gz: 4b900fbcb87df9dd5f23da7f37369abc949532d6efcbabab430ed3059817781a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ce9f1f923cf67945702813a0b1cb5dca896ebb28121cb3dd9d481f59ceda692cc67a89105aca65642c5af66adc5403fd3bceee0dbab07363627391e736a92e2
|
7
|
+
data.tar.gz: cae603a6e76a7f83c1492e9cfeebe01ed668e82def065bab032cd2a66d5df32d808903d5b34f6e660b96de3c179ba2b22971f31fff53d8a2c4fa85a51d6c6295
|
data/.gitignore
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
capistrano-apache (0.0.1)
|
5
|
+
capistrano (~> 3.2)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
airbrussh (1.3.0)
|
11
|
+
sshkit (>= 1.6.1, != 1.7.0)
|
12
|
+
capistrano (3.10.1)
|
13
|
+
airbrussh (>= 1.0.0)
|
14
|
+
i18n
|
15
|
+
rake (>= 10.0.0)
|
16
|
+
sshkit (>= 1.9.0)
|
17
|
+
concurrent-ruby (1.0.5)
|
18
|
+
i18n (0.9.1)
|
19
|
+
concurrent-ruby (~> 1.0)
|
20
|
+
net-scp (1.2.1)
|
21
|
+
net-ssh (>= 2.6.5)
|
22
|
+
net-ssh (4.2.0)
|
23
|
+
rake (10.5.0)
|
24
|
+
sshkit (1.15.1)
|
25
|
+
net-scp (>= 1.1.2)
|
26
|
+
net-ssh (>= 2.8.0)
|
27
|
+
|
28
|
+
PLATFORMS
|
29
|
+
ruby
|
30
|
+
|
31
|
+
DEPENDENCIES
|
32
|
+
capistrano-apache!
|
33
|
+
rake (~> 10.1)
|
34
|
+
|
35
|
+
BUNDLED WITH
|
36
|
+
1.16.0
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2018 Capistrano Plugins
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
# Capistrano Apache
|
2
|
+
|
3
|
+
Official Capistrano extension for Apache tasks.
|
4
|
+
This replaces 1.0.0 of https://rubygems.org/gems/capistrano-apache. *It differs greatly in configuration.*
|
5
|
+
|
6
|
+
### Environments Supported
|
7
|
+
| | systemd | sysv & upstart |
|
8
|
+
| ---- | ------- | -------------- |
|
9
|
+
| HTTPD | ```capistrano/apache/systemd/httpd``` | ```capistrano/apache/sysv_upstart/httpd``` |
|
10
|
+
| APACHE2 | ```capistrano/apache/systemd/apache2``` | ```capistrano/apache/systemd/apache2``` |
|
11
|
+
|
12
|
+
## Installation
|
13
|
+
|
14
|
+
Add this line to your application's Gemfile:
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
gem 'capistrano', '~> 3.2'
|
18
|
+
gem 'capistrano-apache'
|
19
|
+
```
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Require one of the above modules (Environments Supported) in your `Capfile`:
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
require 'capistrano/apache/systemd/httpd'
|
27
|
+
```
|
28
|
+
|
29
|
+
`capistrano/apache` comes with 5 tasks:
|
30
|
+
|
31
|
+
* apache:reload
|
32
|
+
* apache:force_reload
|
33
|
+
* apache:restart
|
34
|
+
* apache:stop
|
35
|
+
* apache:zap
|
36
|
+
|
37
|
+
You can execute the task on command line:
|
38
|
+
|
39
|
+
```bash
|
40
|
+
cap production apache:reload
|
41
|
+
```
|
42
|
+
|
43
|
+
And configure it on your `deploy.rb` file:
|
44
|
+
|
45
|
+
```ruby
|
46
|
+
namespace :deploy do
|
47
|
+
after :finishing, 'apache:reload'
|
48
|
+
after :rollback, 'apache:reload'
|
49
|
+
end
|
50
|
+
```
|
51
|
+
|
52
|
+
### Configuration
|
53
|
+
|
54
|
+
Configurable options shown here are also the defaults:
|
55
|
+
|
56
|
+
```ruby
|
57
|
+
set :apache_with_sudo, true
|
58
|
+
set :apache_roles, :web
|
59
|
+
```
|
60
|
+
|
61
|
+
### More Capistrano automation?
|
62
|
+
|
63
|
+
Check out [capistrano-plugins](https://github.com/capistrano-plugins) github org.
|
64
|
+
|
65
|
+
### Contributing and bug reports
|
66
|
+
|
67
|
+
Contributions and improvements are very welcome.
|
68
|
+
|
69
|
+
If something is not working for you, or you find a bug please report it.
|
70
|
+
|
71
|
+
### Thanks
|
72
|
+
|
73
|
+
* [Sullivan Senechal](https://github.com/Soullivaneuh) @ [NexyLan](https://www.nexylan.com) - Original creator of sysv & upstart code plugin this is heavily based on
|
74
|
+
|
75
|
+
### License
|
76
|
+
|
77
|
+
[MIT](LICENSE.md)
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'capistrano/apache/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = 'capistrano-apache'
|
8
|
+
gem.version = Capistrano::Apache::VERSION
|
9
|
+
gem.summary = 'Capistrano extension for Apache tasks using systemd'
|
10
|
+
gem.description = 'Executes Apache service tasks like reload or restart from Capistrano'
|
11
|
+
gem.authors = ['Sullivan Senechal, Nathan Pierce']
|
12
|
+
gem.email = ['soullivaneuh@gmail.com','connarpierce@gmail.com']
|
13
|
+
gem.homepage = 'https://github.com/capistrano-plugins/capistrano-apache'
|
14
|
+
gem.license = 'MIT'
|
15
|
+
|
16
|
+
gem.files = `git ls-files`.split($/)
|
17
|
+
gem.require_paths = ['lib']
|
18
|
+
|
19
|
+
gem.add_dependency 'capistrano', '~> 3.2'
|
20
|
+
gem.add_development_dependency 'rake', '~> 10.1'
|
21
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
command = '/bin/systemctl'
|
2
|
+
service_name = 'apache2'
|
3
|
+
|
4
|
+
namespace :apache do
|
5
|
+
desc 'Reload apache (requires root access to apache reload)'
|
6
|
+
task :reload do
|
7
|
+
on release_roles(fetch(:apache_roles)) do
|
8
|
+
fetch(:apache_with_sudo) ? execute(:sudo, command, "reload #{service_name}.service") : execute(command, "reload #{service_name}.service")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
desc 'Force reload apache (requires root access to apache reload)'
|
13
|
+
task :force_reload do
|
14
|
+
on release_roles(fetch(:apache_roles)) do
|
15
|
+
fetch(:apache_with_sudo) ? execute(:sudo, command, "force-reload #{service_name}.service") : execute(command, "force-reload #{service_name}.service")
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
desc 'Stop apache (requires root access to apache stop)'
|
20
|
+
task :stop do
|
21
|
+
on release_roles(fetch(:apache_roles)) do
|
22
|
+
fetch(:apache_with_sudo) ? execute(:sudo, command, "stop #{service_name}.service") : execute(command, "stop #{service_name}.service")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
desc 'Start apache (requires root access to apache start)'
|
27
|
+
task :start do
|
28
|
+
on release_roles(fetch(:apache_roles)) do
|
29
|
+
fetch(:apache_with_sudo) ? execute(:sudo, command, "start #{service_name}.service") : execute(command, "start #{service_name}.service")
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
desc 'Restart apache (requires root access to apache restart)'
|
34
|
+
task :restart do
|
35
|
+
on release_roles(fetch(:apache_roles)) do
|
36
|
+
fetch(:apache_with_sudo) ? execute(:sudo, command, "restart #{service_name}.service") : execute(command, "restart #{service_name}.service")
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
|
@@ -0,0 +1,41 @@
|
|
1
|
+
command = '/bin/systemctl'
|
2
|
+
service_name = 'httpd'
|
3
|
+
|
4
|
+
namespace :apache do
|
5
|
+
desc 'Reload apache (requires root access to apache reload)'
|
6
|
+
task :reload do
|
7
|
+
on release_roles(fetch(:apache_roles)) do
|
8
|
+
fetch(:apache_with_sudo) ? execute(:sudo, command, "reload #{service_name}.service"): execute(command, "reload #{service_name}.service")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
desc 'Force reload apache (requires root access to apache reload)'
|
13
|
+
task :force_reload do
|
14
|
+
on release_roles(fetch(:apache_roles)) do
|
15
|
+
fetch(:apache_with_sudo) ? execute(:sudo, command, "force-reload #{service_name}.service") : execute(command, "force-reload #{service_name}.service")
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
desc 'Stop apache (requires root access to apache stop)'
|
20
|
+
task :stop do
|
21
|
+
on release_roles(fetch(:apache_roles)) do
|
22
|
+
fetch(:apache_with_sudo) ? execute(:sudo, command, "stop #{service_name}.service") : execute(command, "stop #{service_name}.service")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
desc 'Start apache (requires root access to apache start)'
|
27
|
+
task :start do
|
28
|
+
on release_roles(fetch(:apache_roles)) do
|
29
|
+
fetch(:apache_with_sudo) ? execute(:sudo, command, "start #{service_name}.service") : execute(command, "start #{service_name}.service")
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
desc 'Restart apache (requires root access to apache restart)'
|
34
|
+
task :restart do
|
35
|
+
on release_roles(fetch(:apache_roles)) do
|
36
|
+
fetch(:apache_with_sudo) ? execute(:sudo, command, "restart #{service_name}.service") : execute(command, "restart #{service_name}.service")
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
|
@@ -0,0 +1,39 @@
|
|
1
|
+
service_name = 'apache2'
|
2
|
+
command = "/etc/init.d/#{service_name}"
|
3
|
+
|
4
|
+
namespace :apache do
|
5
|
+
desc 'Reload apache (requires root access to apache reload)'
|
6
|
+
task :reload do
|
7
|
+
on release_roles(fetch(:apache_roles)) do
|
8
|
+
fetch(:apache_with_sudo) ? execute(:sudo, command, 'reload') : execute(command, 'reload')
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
desc 'Force reload apache (requires root access to apache reload)'
|
13
|
+
task :force_reload do
|
14
|
+
on release_roles(fetch(:apache_roles)) do
|
15
|
+
fetch(:apache_with_sudo) ? execute(:sudo, command, 'force-reload') : execute(command, 'force-reload')
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
desc 'Stop apache (requires root access to apache stop)'
|
20
|
+
task :stop do
|
21
|
+
on release_roles(fetch(:apache_roles)) do
|
22
|
+
fetch(:apache_with_sudo) ? execute(:sudo, command, 'stop') : execute(command, 'stop')
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
desc 'Start apache (requires root access to apache start)'
|
27
|
+
task :start do
|
28
|
+
on release_roles(fetch(:apache_roles)) do
|
29
|
+
fetch(:apache_with_sudo) ? execute(:sudo, command, 'start') : execute(command, 'start')
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
desc 'Restart apache (requires root access to apache restart)'
|
34
|
+
task :restart do
|
35
|
+
on release_roles(fetch(:apache_roles)) do
|
36
|
+
fetch(:apache_with_sudo) ? execute(:sudo, command, 'restart') : execute(command, 'restart')
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -1,44 +1,39 @@
|
|
1
|
+
service_name = 'httpd'
|
2
|
+
command = "/etc/init.d/#{service_name}"
|
3
|
+
|
1
4
|
namespace :apache do
|
2
5
|
desc 'Reload apache (requires root access to apache reload)'
|
3
6
|
task :reload do
|
4
7
|
on release_roles(fetch(:apache_roles)) do
|
5
|
-
execute :
|
8
|
+
fetch(:apache_with_sudo) ? execute(:sudo, command, 'reload') : execute(command, 'reload')
|
6
9
|
end
|
7
10
|
end
|
8
11
|
|
9
12
|
desc 'Force reload apache (requires root access to apache reload)'
|
10
13
|
task :force_reload do
|
11
14
|
on release_roles(fetch(:apache_roles)) do
|
12
|
-
execute :
|
15
|
+
fetch(:apache_with_sudo) ? execute(:sudo, command, 'force-reload') : execute(command, 'force-reload')
|
13
16
|
end
|
14
17
|
end
|
15
18
|
|
16
19
|
desc 'Stop apache (requires root access to apache stop)'
|
17
20
|
task :stop do
|
18
21
|
on release_roles(fetch(:apache_roles)) do
|
19
|
-
execute :
|
22
|
+
fetch(:apache_with_sudo) ? execute(:sudo, command, 'stop') : execute(command, 'stop')
|
20
23
|
end
|
21
24
|
end
|
22
25
|
|
23
26
|
desc 'Start apache (requires root access to apache start)'
|
24
27
|
task :start do
|
25
28
|
on release_roles(fetch(:apache_roles)) do
|
26
|
-
execute :
|
29
|
+
fetch(:apache_with_sudo) ? execute(:sudo, command, 'start') : execute(command, 'start')
|
27
30
|
end
|
28
31
|
end
|
29
32
|
|
30
33
|
desc 'Restart apache (requires root access to apache restart)'
|
31
34
|
task :restart do
|
32
35
|
on release_roles(fetch(:apache_roles)) do
|
33
|
-
execute :
|
36
|
+
fetch(:apache_with_sudo) ? execute(:sudo, command, 'restart') : execute(command, 'restart')
|
34
37
|
end
|
35
38
|
end
|
36
|
-
end
|
37
|
-
|
38
|
-
namespace :load do
|
39
|
-
task :defaults do
|
40
|
-
set :apache_roles, :all
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
SSHKit.config.command_map[:apache] = 'sudo /etc/init.d/apache2'
|
39
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-apache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Sullivan Senechal
|
7
|
+
- Sullivan Senechal, Nathan Pierce
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -41,13 +41,30 @@ dependencies:
|
|
41
41
|
description: Executes Apache service tasks like reload or restart from Capistrano
|
42
42
|
email:
|
43
43
|
- soullivaneuh@gmail.com
|
44
|
+
- connarpierce@gmail.com
|
44
45
|
executables: []
|
45
46
|
extensions: []
|
46
47
|
extra_rdoc_files: []
|
47
48
|
files:
|
48
|
-
-
|
49
|
-
-
|
50
|
-
|
49
|
+
- ".gitignore"
|
50
|
+
- CHANGELOG.md
|
51
|
+
- Gemfile
|
52
|
+
- Gemfile.lock
|
53
|
+
- LICENSE
|
54
|
+
- README.md
|
55
|
+
- Rakefile
|
56
|
+
- capistrano-apache.gemspec
|
57
|
+
- lib/capistrano/apache/apache.rake
|
58
|
+
- lib/capistrano/apache/systemd/apache2.rb
|
59
|
+
- lib/capistrano/apache/systemd/httpd.rb
|
60
|
+
- lib/capistrano/apache/systemd/tasks/apache2.rake
|
61
|
+
- lib/capistrano/apache/systemd/tasks/httpd.rake
|
62
|
+
- lib/capistrano/apache/sysv_upstart/apache2.rb
|
63
|
+
- lib/capistrano/apache/sysv_upstart/httpd.rb
|
64
|
+
- lib/capistrano/apache/sysv_upstart/tasks/apache2.rake
|
65
|
+
- lib/capistrano/apache/sysv_upstart/tasks/httpd.rake
|
66
|
+
- lib/capistrano/apache/version.rb
|
67
|
+
homepage: https://github.com/capistrano-plugins/capistrano-apache
|
51
68
|
licenses:
|
52
69
|
- MIT
|
53
70
|
metadata: {}
|
@@ -67,8 +84,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
67
84
|
version: '0'
|
68
85
|
requirements: []
|
69
86
|
rubyforge_project:
|
70
|
-
rubygems_version: 2.
|
87
|
+
rubygems_version: 2.7.4
|
71
88
|
signing_key:
|
72
89
|
specification_version: 4
|
73
|
-
summary: Capistrano extension for Apache tasks
|
90
|
+
summary: Capistrano extension for Apache tasks using systemd
|
74
91
|
test_files: []
|
data/lib/capistrano/apache.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
load File.expand_path('../tasks/apache.rake', __FILE__)
|