capistrano3-service 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/LICENSE.txt +22 -0
- data/README.md +50 -0
- data/capistrano3-service.gemspec +19 -0
- data/lib/capistrano/service.rb +1 -0
- data/lib/capistrano/tasks/service.rake +18 -0
- data/lib/capistrano3-service.rb +0 -0
- metadata +68 -0
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,50 @@
|
|
1
|
+
# Capistrano::services
|
2
|
+
|
3
|
+
services support for Capistrano 3.x
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'capistrano3-service', '~> 0.1', :github => 'KingCrunch/capistrano3-service'
|
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/service'
|
26
|
+
```
|
27
|
+
|
28
|
+
You will get the following tasks
|
29
|
+
|
30
|
+
```bash
|
31
|
+
cap service:force-reload[service,role] # force-reload service
|
32
|
+
cap service:reload[service,role] # reload service
|
33
|
+
cap service:restart[service,role] # restart service
|
34
|
+
cap service:start[service,role] # start service
|
35
|
+
cap service:status[service,role] # status service
|
36
|
+
cap service:stop[service,role] # stop service
|
37
|
+
```
|
38
|
+
|
39
|
+
It's main purpose is to be used in custom `Capfile` tasks.
|
40
|
+
|
41
|
+
```ruby
|
42
|
+
# Capfile
|
43
|
+
namespace :deploy do
|
44
|
+
task :published do
|
45
|
+
invoke "service:restart", "nginx", :app
|
46
|
+
invoke "service:restart", "php5-fpm", :web
|
47
|
+
end
|
48
|
+
end
|
49
|
+
```
|
50
|
+
|
@@ -0,0 +1,19 @@
|
|
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 |gem|
|
6
|
+
gem.name = 'capistrano3-service'
|
7
|
+
gem.version = '0.1.0'
|
8
|
+
gem.authors = ['Sebastian Krebs']
|
9
|
+
gem.email = ['krebs.seb@gmail.com']
|
10
|
+
gem.description = %q{Adds support for services for Capistrano 3.x}
|
11
|
+
gem.summary = %q{Adds support for services for Capistrano 3.x}
|
12
|
+
gem.homepage = 'https://github.com/KingCrunch/capistrano3-service'
|
13
|
+
gem.license = 'MIT'
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($/)
|
16
|
+
gem.require_paths = ['lib']
|
17
|
+
|
18
|
+
gem.add_dependency 'capistrano', '>= 3.0.0'
|
19
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
load File.expand_path('../tasks/service.rake', __FILE__)
|
@@ -0,0 +1,18 @@
|
|
1
|
+
namespace :service do
|
2
|
+
%w[start stop restart reload force-reload status].each do |command|
|
3
|
+
desc "#{command} service"
|
4
|
+
task command, :service, :role do |t, args|
|
5
|
+
service = args[:service]
|
6
|
+
role = args[:role] || :all
|
7
|
+
|
8
|
+
on release_roles role do
|
9
|
+
within release_path do
|
10
|
+
execute :sudo, :service, "#{service}", "#{command}"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
Rake::Task[t.name].reenable
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
File without changes
|
metadata
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: capistrano3-service
|
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-05-02 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
|
+
description: Adds support for services for Capistrano 3.x
|
31
|
+
email:
|
32
|
+
- krebs.seb@gmail.com
|
33
|
+
executables: []
|
34
|
+
extensions: []
|
35
|
+
extra_rdoc_files: []
|
36
|
+
files:
|
37
|
+
- LICENSE.txt
|
38
|
+
- README.md
|
39
|
+
- capistrano3-service.gemspec
|
40
|
+
- lib/capistrano/service.rb
|
41
|
+
- lib/capistrano/tasks/service.rake
|
42
|
+
- lib/capistrano3-service.rb
|
43
|
+
homepage: https://github.com/KingCrunch/capistrano3-service
|
44
|
+
licenses:
|
45
|
+
- MIT
|
46
|
+
post_install_message:
|
47
|
+
rdoc_options: []
|
48
|
+
require_paths:
|
49
|
+
- lib
|
50
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
requirements: []
|
63
|
+
rubyforge_project:
|
64
|
+
rubygems_version: 1.8.23
|
65
|
+
signing_key:
|
66
|
+
specification_version: 3
|
67
|
+
summary: Adds support for services for Capistrano 3.x
|
68
|
+
test_files: []
|