capistrano-apache 2.0.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -1
- data/README.md +8 -6
- data/lib/capistrano/apache/apache.rake +2 -0
- data/lib/capistrano/apache/systemd.rb +2 -0
- data/lib/capistrano/apache/sysv_upstart.rb +2 -0
- data/lib/capistrano/apache/tasks/systemd.rake +38 -0
- data/lib/capistrano/apache/tasks/sysv_upstart.rake +36 -0
- data/lib/capistrano/apache/version.rb +1 -1
- metadata +6 -10
- data/lib/capistrano/apache/systemd/apache2.rb +0 -2
- data/lib/capistrano/apache/systemd/httpd.rb +0 -2
- data/lib/capistrano/apache/systemd/tasks/apache2.rake +0 -41
- data/lib/capistrano/apache/systemd/tasks/httpd.rake +0 -41
- data/lib/capistrano/apache/sysv_upstart/apache2.rb +0 -2
- data/lib/capistrano/apache/sysv_upstart/httpd.rb +0 -2
- data/lib/capistrano/apache/sysv_upstart/tasks/apache2.rake +0 -39
- data/lib/capistrano/apache/sysv_upstart/tasks/httpd.rake +0 -39
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0db08b81bd2bcaef3ea610b19b42108736a038efd34173d7e00f4331789e1ab
|
4
|
+
data.tar.gz: bac4c2b9d0995f4ac17714ef65977f32ce98019ac9f385c8515ac6674989261e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e3a9fe06a669a0d76c8216f0e718b9bb7163be6e58005806cb8d68dfa0d15ee4d3c733178a44826cb34c975c983cd8924dbf1bafe412643e1450abcc5e9c66b
|
7
|
+
data.tar.gz: 3c9580b14928efb1c2d57ac168abda60348fa4563a8bf0b5d659c00ca54fe873c5744278ea470892b0ed2f7b21df38b3afe8d6407939ff14f8c7cee075a39c31
|
data/CHANGELOG.md
CHANGED
@@ -1,2 +1,5 @@
|
|
1
|
-
###
|
1
|
+
### v3.0.0, 2018-01-27
|
2
|
+
- Rewrite of systemd/sysv_upstart require structure
|
3
|
+
- New :systemctl_location and :apache_service_name you can set for httpd or apache2
|
4
|
+
### v2.0.0, 2018-01-02
|
2
5
|
- Functional for sysv, upstart, and systemd apache2 and httpd environments
|
data/README.md
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
# Capistrano Apache
|
2
2
|
|
3
3
|
Official Capistrano extension for Apache tasks.
|
4
|
+
Supports httpd and apache2 (see Configuration below)
|
4
5
|
This replaces 1.0.0 of https://rubygems.org/gems/capistrano-apache. *It differs greatly in configuration.*
|
5
6
|
|
6
7
|
### Environments Supported
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
| APACHE2 | ```capistrano/apache/systemd/apache2``` | ```capistrano/apache/systemd/apache2``` |
|
8
|
+
| systemd | sysv & upstart |
|
9
|
+
| ------- | -------------- |
|
10
|
+
| ```capistrano/apache/systemd``` | ```capistrano/apache/sysv_upstart``` |
|
11
11
|
|
12
12
|
## Installation
|
13
13
|
|
@@ -20,10 +20,10 @@ gem 'capistrano-apache'
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
Require one of the above
|
23
|
+
Require one of the above 'Environments Supported' in your `Capfile`:
|
24
24
|
|
25
25
|
```ruby
|
26
|
-
require 'capistrano/apache/systemd
|
26
|
+
require 'capistrano/apache/systemd'
|
27
27
|
```
|
28
28
|
|
29
29
|
`capistrano/apache` comes with 5 tasks:
|
@@ -56,6 +56,8 @@ Configurable options shown here are also the defaults:
|
|
56
56
|
```ruby
|
57
57
|
set :apache_with_sudo, true
|
58
58
|
set :apache_roles, :web
|
59
|
+
set :apache_service_name, 'httpd' # Specify apache2 here if needed
|
60
|
+
set :systemctl_location, '/bin/systemctl' # May already exist if you use other plugins. Be sure to check your config/deploy/{env} file
|
59
61
|
```
|
60
62
|
|
61
63
|
### More Capistrano automation?
|
@@ -0,0 +1,38 @@
|
|
1
|
+
namespace :apache do
|
2
|
+
desc 'Reload apache (requires root access to apache reload)'
|
3
|
+
task :reload do
|
4
|
+
on release_roles(fetch(:apache_roles)) do
|
5
|
+
fetch(:apache_with_sudo) ? execute(:sudo, fetch(:systemctl_location), "reload #{fetch(:apache_service_name)}.service"): execute(fetch(:systemctl_location), "reload #{fetch(:apache_service_name)}.service")
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
desc 'Force reload apache (requires root access to apache reload)'
|
10
|
+
task :force_reload do
|
11
|
+
on release_roles(fetch(:apache_roles)) do
|
12
|
+
fetch(:apache_with_sudo) ? execute(:sudo, fetch(:systemctl_location), "force-reload #{fetch(:apache_service_name)}.service") : execute(fetch(:systemctl_location), "force-reload #{fetch(:apache_service_name)}.service")
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
desc 'Stop apache (requires root access to apache stop)'
|
17
|
+
task :stop do
|
18
|
+
on release_roles(fetch(:apache_roles)) do
|
19
|
+
fetch(:apache_with_sudo) ? execute(:sudo, fetch(:systemctl_location), "stop #{fetch(:apache_service_name)}.service") : execute(fetch(:systemctl_location), "stop #{fetch(:apache_service_name)}.service")
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
desc 'Start apache (requires root access to apache start)'
|
24
|
+
task :start do
|
25
|
+
on release_roles(fetch(:apache_roles)) do
|
26
|
+
fetch(:apache_with_sudo) ? execute(:sudo, fetch(:systemctl_location), "start #{fetch(:apache_service_name)}.service") : execute(fetch(:systemctl_location), "start #{fetch(:apache_service_name)}.service")
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
desc 'Restart apache (requires root access to apache restart)'
|
31
|
+
task :restart do
|
32
|
+
on release_roles(fetch(:apache_roles)) do
|
33
|
+
fetch(:apache_with_sudo) ? execute(:sudo, fetch(:systemctl_location), "restart #{fetch(:apache_service_name)}.service") : execute(fetch(:systemctl_location), "restart #{fetch(:apache_service_name)}.service")
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
|
@@ -0,0 +1,36 @@
|
|
1
|
+
namespace :apache do
|
2
|
+
desc 'Reload apache'
|
3
|
+
task :reload do
|
4
|
+
on release_roles(fetch(:apache_roles)) do
|
5
|
+
fetch(:apache_with_sudo) ? execute(:sudo, "/etc/init.d/#{fetch(:apache_service_name)}", 'reload') : execute("/etc/init.d/#{fetch(:apache_service_name)}", 'reload')
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
desc 'Force reload apache'
|
10
|
+
task :force_reload do
|
11
|
+
on release_roles(fetch(:apache_roles)) do
|
12
|
+
fetch(:apache_with_sudo) ? execute(:sudo, "/etc/init.d/#{fetch(:apache_service_name)}", 'force-reload') : execute("/etc/init.d/#{fetch(:apache_service_name)}", 'force-reload')
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
desc 'Stop apache'
|
17
|
+
task :stop do
|
18
|
+
on release_roles(fetch(:apache_roles)) do
|
19
|
+
fetch(:apache_with_sudo) ? execute(:sudo, "/etc/init.d/#{fetch(:apache_service_name)}", 'stop') : execute("/etc/init.d/#{fetch(:apache_service_name)}", 'stop')
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
desc 'Start apache'
|
24
|
+
task :start do
|
25
|
+
on release_roles(fetch(:apache_roles)) do
|
26
|
+
fetch(:apache_with_sudo) ? execute(:sudo, "/etc/init.d/#{fetch(:apache_service_name)}", 'start') : execute("/etc/init.d/#{fetch(:apache_service_name)}", 'start')
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
desc 'Restart apache'
|
31
|
+
task :restart do
|
32
|
+
on release_roles(fetch(:apache_roles)) do
|
33
|
+
fetch(:apache_with_sudo) ? execute(:sudo, "/etc/init.d/#{fetch(:apache_service_name)}", 'restart') : execute("/etc/init.d/#{fetch(:apache_service_name)}", 'restart')
|
34
|
+
end
|
35
|
+
end
|
36
|
+
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: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sullivan Senechal, Nathan Pierce
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -55,14 +55,10 @@ files:
|
|
55
55
|
- Rakefile
|
56
56
|
- capistrano-apache.gemspec
|
57
57
|
- lib/capistrano/apache/apache.rake
|
58
|
-
- lib/capistrano/apache/systemd
|
59
|
-
- lib/capistrano/apache/
|
60
|
-
- lib/capistrano/apache/
|
61
|
-
- lib/capistrano/apache/
|
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
|
58
|
+
- lib/capistrano/apache/systemd.rb
|
59
|
+
- lib/capistrano/apache/sysv_upstart.rb
|
60
|
+
- lib/capistrano/apache/tasks/systemd.rake
|
61
|
+
- lib/capistrano/apache/tasks/sysv_upstart.rake
|
66
62
|
- lib/capistrano/apache/version.rb
|
67
63
|
homepage: https://github.com/capistrano-plugins/capistrano-apache
|
68
64
|
licenses:
|
@@ -1,41 +0,0 @@
|
|
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
|
-
|
@@ -1,41 +0,0 @@
|
|
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
|
-
|
@@ -1,39 +0,0 @@
|
|
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,39 +0,0 @@
|
|
1
|
-
service_name = 'httpd'
|
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
|