capistrano-systemd-ng 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +2 -1
- data/README.md +35 -1
- data/capistrano-systemd-ng.gemspec +1 -1
- data/lib/capistrano/systemd/multiservice/system_service.rb +1 -1
- data/lib/capistrano/systemd/multiservice/user_service.rb +2 -0
- data/lib/capistrano/systemd/multiservice/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a50ddb67a418be03b5d2920ae7f6ae33de0599517ad6d7120ddcd4918a4a325b
|
4
|
+
data.tar.gz: a8974fa62acd4a059346cc4a7ecea4eeddae91e5b753504b05ed6500a6fd067c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9002a9eeebb5ffa552d66f3339ca2121ab825455545bdf861bf9653d0d8691f0243ded4c8273f06c893d4d06068bc21b1ba80930ee8042a8f179e06d79398318
|
7
|
+
data.tar.gz: 561b0469b18e7b0d5d2578827ae746ac41298464381889a84e70edd7ca7a128cdc6cc5031fd7cb59e8b375ba7cb106c2d3f681d23014fec62543b086bdb6d4a6
|
data/LICENSE
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
MIT License
|
2
2
|
|
3
|
-
Copyright (c)
|
3
|
+
Copyright (c) 2023 Gaspard d'Hautefeuille, Danil Pismenny
|
4
|
+
Copyright (c) 2016-2022 YAMADA Tsuyoshi
|
4
5
|
|
5
6
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
7
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# capistrano-systemd-ng
|
2
2
|
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/capistrano-systemd-ng.
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/capistrano-systemd-ng.svg)](https://rubygems.org/gems/capistrano-systemd-ng) [![CI](https://github.com/HLFH/capistrano-systemd-ng/actions/workflows/ci.yml/badge.svg)](https://github.com/HLFH/capistrano-systemd-ng/actions/workflows/ci.yml)
|
4
4
|
|
5
5
|
This gem adds capistrano tasks to control multiple services with systemd.
|
6
6
|
This gem supports capistrano > 3.17.0.
|
@@ -83,6 +83,40 @@ If using the user service type services will be installed in your users home dir
|
|
83
83
|
Systemd commands on those services can be run by passing a `--user` flag, e.g. ```systemctl --user list-unit-files```
|
84
84
|
Nothing else in setup should require change and Capistrano tasks should remain the same as when installing system services.
|
85
85
|
|
86
|
+
Example of user service in `config/systemd/passenger.service.erb`:
|
87
|
+
```
|
88
|
+
[Unit]
|
89
|
+
Description=Passenger Standalone Application Server for <%= fetch(:application) %>
|
90
|
+
After=network.target
|
91
|
+
|
92
|
+
[Service]
|
93
|
+
Type=forking
|
94
|
+
Environment=RAILS_ENV=<%= fetch(:rails_env) %>
|
95
|
+
Environment=PWD=<%= current_path %>
|
96
|
+
WorkingDirectory=<%= current_path %>
|
97
|
+
PIDFile=/run/passenger/devopsy.pid
|
98
|
+
ExecStart=/home/deploy/.asdf/bin/asdf exec bundle exec passenger start -d --pid-file /run/passenger/devopsy.pid -e production -p 3002 --instance-registry-dir /run/passenger
|
99
|
+
ExecStop=/home/deploy/.asdf/bin/asdf exec bundle exec passenger stop --pid-file /run/passenger/devopsy.pid
|
100
|
+
PrivateTmp=yes
|
101
|
+
|
102
|
+
[Install]
|
103
|
+
WantedBy=default.target
|
104
|
+
```
|
105
|
+
For user services, the target should be `default.target`, not `multi-user.target`.
|
106
|
+
And no `User` or `Group` should be mentioned to avoid errors.
|
107
|
+
|
108
|
+
It is in `config/deploy.rb` that you should have the user set, and for that example:
|
109
|
+
```
|
110
|
+
set :user, "deploy"
|
111
|
+
after 'deploy:publishing', 'systemd:passenger:restart'
|
112
|
+
```
|
113
|
+
|
114
|
+
And in the `Capfile`, you should have these:
|
115
|
+
```
|
116
|
+
require "capistrano/systemd/multiservice"
|
117
|
+
install_plugin Capistrano::Systemd::MultiService.new_service("passenger", service_type: "user")
|
118
|
+
```
|
119
|
+
|
86
120
|
## Capistrano Tasks
|
87
121
|
|
88
122
|
With `install_plugin Capistrano::Systemd::MultiService.new_service("example1")`,
|
@@ -25,5 +25,5 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.add_development_dependency "bundler"
|
26
26
|
spec.add_development_dependency "rake"
|
27
27
|
spec.add_development_dependency "rspec", "~> 3.0"
|
28
|
-
spec.add_development_dependency "mocha", "~>
|
28
|
+
spec.add_development_dependency "mocha", "~> 2.0"
|
29
29
|
end
|
@@ -42,7 +42,7 @@ module Capistrano
|
|
42
42
|
|
43
43
|
set_if_empty :"#{prefix}_units_dest", ->{
|
44
44
|
fetch(:"#{prefix}_units_src").map{|src|
|
45
|
-
"%s/%s_%s" % [ fetch(:"#{prefix}_units_dir"), fetch(:application), File.basename(src, ".erb") ]
|
45
|
+
"%s/%s_%s-%s" % [ fetch(:"#{prefix}_units_dir"), fetch(:application), fetch(:stage), File.basename(src, ".erb") ]
|
46
46
|
}
|
47
47
|
}
|
48
48
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-systemd-ng
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gaspard d'Hautefeuille
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-06-
|
12
|
+
date: 2023-06-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano
|
@@ -79,14 +79,14 @@ dependencies:
|
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '2.0'
|
83
83
|
type: :development
|
84
84
|
prerelease: false
|
85
85
|
version_requirements: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '2.0'
|
90
90
|
description: Capistrano Plugin to control services by systemd (supports capistrano
|
91
91
|
> 3.17.0)
|
92
92
|
email:
|