capistrano-solid_queue 0.1.0 → 0.1.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4ca4bdb0350bc571d3b3f888d53331863639948e3eaeed1ce2b7854f2b5955a
4
- data.tar.gz: 4032721e0def7e6cfd673754d3327df4bffb4ae6c1273aff193887007cce6b85
3
+ metadata.gz: c04a8eebc3b4b5598a9eac1e362a1196778b43229f42d1f7734492794fd57207
4
+ data.tar.gz: b9dabd1aee6c8cee17eff11aab13a3f2324906bd394ea74cb406d93aca41d32a
5
5
  SHA512:
6
- metadata.gz: 1072a98ca0a2485956334d46f4f857369c9643f05c0e49e63a83ec61a998f980751843a4531aef5f6aff988b25aec6731b890bebe334f3b1e75e7b87511127e5
7
- data.tar.gz: 0bc1d5232c7a61fc18802401e7d0d7bcaec9b84cc5e37b0b8e28cc1bd086e7905f63c92def2aba1457847bcca90f21e23aed0a67babd84e0bac1f6ee1fea3a0a
6
+ metadata.gz: 9fefa8f089252a38a0612cd7579a82245b17ae739ef3c7c358041945e68e661f219e7b939e5854e5145727da5f6afd5d6a5b4cde18f179073383f3eea2b4e660
7
+ data.tar.gz: 48b8ab02509a1e15855f0c1017d5adf2ebb2b68cdab91c213058bfa96a80f519e027d3505e271a5ee7263c47a2dca6b932736bae6f74772e5813477e3f0f6c32
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.2] - 2025-06-12
4
+
5
+ - Quiet task only runs on :solid_queue_role [#3](https://github.com/codeur/capistrano-solid_queue/pull/5) by [@bashcoder](https://github.com/bashcoder)
6
+
7
+ ## [0.1.1] - 2025-03-27
8
+
9
+ - Fix system user [#2](https://github.com/codeur/capistrano-solid_queue/pull/2) by [@lubosch](https://github.com/lubosch)
10
+
3
11
  ## [0.1.0] - 2024-04-22
4
12
 
5
13
  - Initial release
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Capistrano
4
4
  module SolidQueue
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.2"
6
6
  end
7
7
  end
@@ -25,8 +25,25 @@ module Capistrano
25
25
  end
26
26
 
27
27
  def execute_systemd(*args, raise_on_non_zero_exit: true)
28
- command = ["/bin/systemctl", "--user"] + args
29
- backend.execute(*command, raise_on_non_zero_exit: raise_on_non_zero_exit)
28
+ sudo_if_needed(*systemd_command(*args), raise_on_non_zero_exit: true)
29
+ end
30
+
31
+ def sudo_if_needed(*command, raise_on_non_zero_exit: true)
32
+ if fetch(:solid_queue_systemctl_user) == :system
33
+ backend.sudo command.map(&:to_s).join(" ")
34
+ else
35
+ backend.execute(*command, raise_on_non_zero_exit: raise_on_non_zero_exit)
36
+ end
37
+ end
38
+
39
+ def systemd_command(*args)
40
+ command = ["/bin/systemctl"]
41
+
42
+ unless fetch(:solid_queue_systemctl_user) == :system
43
+ command << "--user"
44
+ end
45
+
46
+ command + args
30
47
  end
31
48
 
32
49
  def fetch_systemd_unit_path
@@ -60,7 +60,7 @@ namespace :solid_queue do # rubocop:disable Metrics
60
60
 
61
61
  desc "Quiet solid_queue (start graceful termination)"
62
62
  task :quiet do
63
- on roles(:app) do
63
+ on roles(fetch(:solid_queue_role)) do
64
64
  plugin.execute_systemd("kill", "-s", "SIGTERM", fetch(:solid_queue_service_unit_name), raise_on_non_zero_exit: false)
65
65
  end
66
66
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-solid_queue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brice TEXIER
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-22 00:00:00.000000000 Z
11
+ date: 2025-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -65,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
65
  - !ruby/object:Gem::Version
66
66
  version: '0'
67
67
  requirements: []
68
- rubygems_version: 3.3.26
68
+ rubygems_version: 3.5.22
69
69
  signing_key:
70
70
  specification_version: 4
71
71
  summary: Adds support for SolidQueue to Capistrano 3.x