groovenauts / capistrano-systemd-multiservice

Capistrano Plugin to control services with systemd
MIT License
45 stars 17 forks source link

Renamed Capistrano::Systemd::MultiService class to Capistrano::Systemd::MultiService::SystemService #10

Closed minimum2scp closed 6 years ago

minimum2scp commented 6 years ago

Background

https://github.com/groovenauts/capistrano-systemd-multiservice/pull/9#issuecomment-397934997

Changes

Migration guide for users

This is a breaking change for users (who maintain Capfile).

Capfile should be migrated from

require "capistrano/systemd/multiservice"
install_plugin Capistrano::Systemd::MultiService.new("example1")
install_plugin Capistrano::Systemd::MultiService.new("example2")

to

require "capistrano/systemd/multiservice"
install_plugin Capistrano::Systemd::MultiService.new_service("example1")
install_plugin Capistrano::Systemd::MultiService.new_service("example2")

For developers

Now you can define your own class like this:

module Capistrano module Systemd module MultiSerivce def self.new_service(app, custom_service: false) if custom_service CustomService.new(app) else SystemService.new(app) end end end end end

* lib/capistrano/systemd/multiservice/custom_service.rb:
```ruby
require "capistrano/systemd/multiservice/system_service" # or "capistrano/plugin"

module Capistrano
  module Systemd
    module MultiService
      class CustomService < SystemService # or ::Capistrano::Plugin
        #
        # your custom code
        #
minimum2scp commented 6 years ago

Released v0.1.0.beta6