capistrano-upstart-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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b3e6a1dc25b2a06207b0a80cf279fdaf7037c5fb
4
+ data.tar.gz: ae9d770f3d7757b3638b1219ba0e8793f8c2cb9f
5
+ SHA512:
6
+ metadata.gz: 82d3ed88187b91b6ed89a2b26e0f77d983f69ea6483daeb6979618d6c6c7a41fab7599ae8f2ba2ec1de7240fb8139fac5357a4a2c48ff01242b1e97bca632d75
7
+ data.tar.gz: 9940b4a7e1cd839b03933bbd9e81021ed657b33aa064c57ac100a4932dee2b1b27d627eb90439e21679a476114357816ae306e851370c32b55d4035ac8b9e122
@@ -0,0 +1 @@
1
+ *.gem
@@ -0,0 +1,9 @@
1
+ # Capistrano::Upstart::Service Changelog
2
+
3
+ Reverse Chronological Order:
4
+
5
+ ## `0.1.0`
6
+
7
+ Initial release.
8
+
9
+ * Support for start, stop, restart, reload and status commands.
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
@@ -0,0 +1,34 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ capistrano-upstart-service (0.1.0)
5
+ capistrano (>= 3.0.0.pre)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ capistrano (3.4.0)
11
+ i18n
12
+ rake (>= 10.0.0)
13
+ sshkit (~> 1.3)
14
+ colorize (0.7.7)
15
+ i18n (0.7.0)
16
+ net-scp (1.2.1)
17
+ net-ssh (>= 2.6.5)
18
+ net-ssh (2.9.2)
19
+ rake (10.4.2)
20
+ sshkit (1.7.1)
21
+ colorize (>= 0.7.0)
22
+ net-scp (>= 1.1.2)
23
+ net-ssh (>= 2.8.0)
24
+
25
+ PLATFORMS
26
+ ruby
27
+
28
+ DEPENDENCIES
29
+ bundler (~> 1.3)
30
+ capistrano-upstart-service!
31
+ rake
32
+
33
+ BUNDLED WITH
34
+ 1.10.4
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2015 PJ Kelly (Crush & Lovely)
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
13
+ all 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
21
+ THE SOFTWARE.
@@ -0,0 +1,68 @@
1
+ # Capistrano Upstart Service
2
+
3
+ Define Capistrano 3.x tasks for your Upstart services via a simple YAML configuration file.
4
+
5
+ This gem is the successor to [capistrano-service](https://github.com/crushlovely/capistrano-service).
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'capistrano', '~> 3.0.0'
13
+ gem 'capistrano-upstart-service'
14
+ ```
15
+
16
+ And then execute:
17
+
18
+ $ bundle
19
+
20
+ Or install it yourself as:
21
+
22
+ $ gem install capistrano-upstart-service
23
+
24
+ ## Setup
25
+
26
+ ``` ruby
27
+ require 'capistrano/upstart/service'
28
+ ```
29
+
30
+ Then add a file named `config/capistrano-upstart-service.yml` in your project with the following content:
31
+
32
+ ``` yaml
33
+ upstart_services:
34
+ - name: nginx
35
+ roles: :all
36
+ ```
37
+
38
+ Once you've done this, you'll see that several tasks are defined for each service you added:
39
+
40
+ ``` bash
41
+ $ cap -T
42
+ ...
43
+ cap nginx:reload # Reload the nginx service via upstart on all servers
44
+ cap nginx:restart # Restart the nginx service via upstart on all servers
45
+ cap nginx:start # Start the nginx service via upstart on all servers
46
+ cap nginx:status # Status the nginx service via upstart on all servers
47
+ cap nginx:stop # Stop the nginx service via upstart on all servers
48
+ ```
49
+
50
+ You can add as many services to this YAML file as you like; tasks will be defined for all of them. If you omit the `roles` option, the service will default to `:all`.
51
+
52
+ ## Usage
53
+
54
+ Once you've set everything up, simply call your tasks directly (`cap nginx:restart`), or add them to your deploy flow:
55
+
56
+ ``` ruby
57
+ namespace :deploy do
58
+ after :publishing, 'nginx:restart', 'unicorn:restart'
59
+ end
60
+ ```
61
+
62
+ ## Contributing
63
+
64
+ 1. Fork it
65
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
66
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
67
+ 4. Push to the branch (`git push origin my-new-feature`)
68
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,24 @@
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 = 'capistrano-upstart-service'
7
+ spec.version = '0.1.0'
8
+ spec.authors = ['PJ Kelly']
9
+ spec.email = ['pj@crushlovely.com']
10
+ spec.description = %q{Easily define Capistrano 3.x tasks for your Upstart services.}
11
+ spec.summary = spec.description
12
+ spec.homepage = 'https://github.com/crushlovely/capistrano-upstart-service'
13
+ spec.license = 'MIT'
14
+
15
+ spec.files = `git ls-files -z`.split("\x0")
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ['lib']
19
+
20
+ spec.add_dependency 'capistrano', '>= 3.0.0.pre'
21
+
22
+ spec.add_development_dependency 'bundler', '~> 1.3'
23
+ spec.add_development_dependency 'rake'
24
+ end
File without changes
@@ -0,0 +1,25 @@
1
+ upstart_configuration = YAML.load_file('config/capistrano-upstart-service.yml')['upstart_services']
2
+
3
+ def upstart_description(command, service)
4
+ "#{command.capitalize} the #{service['name']} service via upstart on #{service['roles']} servers."
5
+ end
6
+
7
+ upstart_configuration.each do |service|
8
+ %w(start stop restart).each do |command|
9
+ desc upstart_description(command, service)
10
+ Rake::Task.define_task("#{service['name']}:#{command}") do |t|
11
+ on roles (service['roles'] || :all) do
12
+ execute :sudo, command, service['name']
13
+ end
14
+ end
15
+ end
16
+
17
+ %w(reload status).each do |command|
18
+ desc upstart_description(command, service)
19
+ Rake::Task.define_task("#{service['name']}:#{command}") do |t|
20
+ on roles (service['roles'] || :all) do
21
+ info capture("sudo #{command} #{service['name']}")
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1 @@
1
+ load File.expand_path('../tasks/upstart-service.rake', __FILE__)
@@ -0,0 +1 @@
1
+ load File.expand_path('../../tasks/upstart-service.rake', __FILE__)
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-upstart-service
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - PJ Kelly
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-07-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: capistrano
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 3.0.0.pre
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 3.0.0.pre
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.3'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Easily define Capistrano 3.x tasks for your Upstart services.
56
+ email:
57
+ - pj@crushlovely.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - CHANGELOG.md
64
+ - Gemfile
65
+ - Gemfile.lock
66
+ - LICENSE
67
+ - README.md
68
+ - Rakefile
69
+ - capistrano-upstart-service.gemspec
70
+ - lib/capistrano-upstart-service.rb
71
+ - lib/capistrano/tasks/upstart-service.rake
72
+ - lib/capistrano/upstart.rb
73
+ - lib/capistrano/upstart/service.rb
74
+ homepage: https://github.com/crushlovely/capistrano-upstart-service
75
+ licenses:
76
+ - MIT
77
+ metadata: {}
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubyforge_project:
94
+ rubygems_version: 2.4.5
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: Easily define Capistrano 3.x tasks for your Upstart services.
98
+ test_files: []
99
+ has_rdoc: