capistrano-systemd-ng 0.1.2 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d2465b8af1c66f78bb36e1b385b74eb6dc1c083148c1925c8fceec6a036ddb4
4
- data.tar.gz: 9595a31afc13f291f32aafaabc604e52aa0ddcd0f1a6087d4370d799f59602ad
3
+ metadata.gz: bb84da1ac6f33cc067142d9dd9348c7815583319ca23e64c2e90f1c30799810f
4
+ data.tar.gz: 293ed348d3871183e49ae5ce4ab4c7bed5ba31c7734306c4f50b3c8aff7fd61e
5
5
  SHA512:
6
- metadata.gz: 58dee30948ac5ea137e01f67435104342b56dfb843f3c05bf21bca7022595a01e7c698bbd5bc8dbdc67ce613bf3fdbe64e797ee2b7059d5524b16924ecda5b6d
7
- data.tar.gz: 0d6f526890d527b3e23990954c6018951839177e20b7d95d1dd82d04bd7736e16693d91e5d5b02f5fa03d97bdf296672ac8d35f508e6c8694a5f1155b7dba884
6
+ metadata.gz: 0c742af5b9d483b4a8ae1e439bce8bf59cc6236e8a8a98de56e9d7f4935966006aa2a9599ef9edd4fb66d3acac4b5eff590fd98256a13314801b80fd5a493edc
7
+ data.tar.gz: 8b7a28307b5bbe1edf285cb7838e961dd76c9c3ead8981c9d29c53751475dc918ac1d92d9eeaed92cf980751793fd0976b59fa3acbeb31e5f5fdebc52e552f92
@@ -15,7 +15,7 @@ jobs:
15
15
  runs-on: ubuntu-latest
16
16
  strategy:
17
17
  matrix:
18
- ruby-version: [2.7, '3.0', 3.1]
18
+ ruby-version: [2.7, 3.0, 3.1, 3.2.2]
19
19
  fail-fast: false
20
20
  if: "!contains(github.event.head_commit.message, '[ci skip]')"
21
21
  steps:
data/LICENSE CHANGED
@@ -1,6 +1,7 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2016 YAMADA Tsuyoshi
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.png)](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)
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.
@@ -23,7 +23,13 @@ Or install it yourself as:
23
23
 
24
24
  ## Usage
25
25
 
26
- Add these lines to your Capfile:
26
+ Please activate the Capistrano `app`role in `config/deploy/staging.rb`and/or `config/deploy/production.rb`:
27
+ ```
28
+ role :app, %w{deploy@example.com}
29
+ ```
30
+ Replace `example.com` by the domain name used by your server.
31
+
32
+ And add these lines to your Capfile:
27
33
 
28
34
  ```ruby
29
35
  require "capistrano/systemd/multiservice"
@@ -83,6 +89,40 @@ If using the user service type services will be installed in your users home dir
83
89
  Systemd commands on those services can be run by passing a `--user` flag, e.g. ```systemctl --user list-unit-files```
84
90
  Nothing else in setup should require change and Capistrano tasks should remain the same as when installing system services.
85
91
 
92
+ Example of user service in `config/systemd/passenger.service.erb`:
93
+ ```
94
+ [Unit]
95
+ Description=Passenger Standalone Application Server for <%= fetch(:application) %>
96
+ After=network.target
97
+
98
+ [Service]
99
+ Type=forking
100
+ Environment=RAILS_ENV=<%= fetch(:rails_env) %>
101
+ Environment=PWD=<%= current_path %>
102
+ WorkingDirectory=<%= current_path %>
103
+ PIDFile=/run/passenger/devopsy.pid
104
+ 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
105
+ ExecStop=/home/deploy/.asdf/bin/asdf exec bundle exec passenger stop --pid-file /run/passenger/devopsy.pid
106
+ PrivateTmp=yes
107
+
108
+ [Install]
109
+ WantedBy=default.target
110
+ ```
111
+ For user services, the target should be `default.target`, not `multi-user.target`.
112
+ And no `User` or `Group` should be mentioned to avoid errors.
113
+
114
+ It is in `config/deploy.rb` that you should have the user set, and for that example:
115
+ ```
116
+ set :user, "deploy"
117
+ after 'deploy:publishing', 'systemd:passenger:restart'
118
+ ```
119
+
120
+ And in the `Capfile`, you should have these:
121
+ ```
122
+ require "capistrano/systemd/multiservice"
123
+ install_plugin Capistrano::Systemd::MultiService.new_service("passenger", service_type: "user")
124
+ ```
125
+
86
126
  ## Capistrano Tasks
87
127
 
88
128
  With `install_plugin Capistrano::Systemd::MultiService.new_service("example1")`,
@@ -77,7 +77,7 @@ module Capistrano
77
77
 
78
78
  def setup
79
79
  fetch(:"#{prefix}_units_src").zip(fetch(:"#{prefix}_units_dest")).each do |src, dest|
80
- buf = StringIO.new(ERB.new(File.read(src), nil, 2).result(binding))
80
+ buf = StringIO.new(ERB.new(File.read(src), trim_mode: '-', eoutvar: '@output_buffer').result(binding))
81
81
  setup_service buf, src, dest
82
82
  end
83
83
  end
@@ -1,7 +1,7 @@
1
1
  module Capistrano
2
2
  module Systemd
3
3
  module MultiService
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.4"
5
5
  end
6
6
  end
7
7
  end
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.2
4
+ version: 0.1.4
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-22 00:00:00.000000000 Z
12
+ date: 2023-06-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano