capistrano-solid_queue 0.1.3 → 0.2.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +33 -1
- data/README.md +75 -16
- data/lib/capistrano/solid_queue/version.rb +1 -1
- data/lib/capistrano/solid_queue.rb +10 -1
- data/lib/capistrano/tasks/solid_queue.rake +11 -37
- data/lib/capistrano/templates/solid_queue.service.erb +11 -3
- metadata +9 -11
- data/.standard.yml +0 -3
- data/Rakefile +0 -14
- data/sig/capistrano/solid_queue.rbs +0 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b7813736623d35e8c351f92ec7d0cf06cc5afcb022b1db19a498d21bf3de0186
|
|
4
|
+
data.tar.gz: e7972afc9f6ac146598eccb98f5dbe6c2a9bcfd9c048fa0e741722d0deef4fbd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 132a4b6047cdcebc00e0480839db4544805620b9666e881beac83aee567f3ab2798a86cf18c0bef568eb529accae52213e765789e0c7c23007d603c321617f2c
|
|
7
|
+
data.tar.gz: 209afad9b358b958a96fd5c48feffb10620a2ac0fa963d29d0f4ccc70e08568ea3b3368a80ae45f384ae7fe2dc01149de9ee5ba73b7f93d4992a29832a028923
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,37 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.2.0] - 2026-11-09
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- `:solid_queue_service_unit_env_vars` and `:solid_queue_service_unit_env_files` add `Environment=` and `EnvironmentFile=` lines to the systemd service. They default to `:service_unit_env_vars` and `:service_unit_env_files`, as in capistrano3-puma and capistrano-sidekiq ([#13](https://github.com/codeur/capistrano-solid_queue/pull/13), from [#6](https://github.com/codeur/capistrano-solid_queue/pull/6) by [@floriancrusius](https://github.com/floriancrusius)).
|
|
14
|
+
- A Configuration section in the README ([#13](https://github.com/codeur/capistrano-solid_queue/pull/13)).
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- In `:system` mode, the service runs as the user Capistrano connects with instead of root. Run `cap <stage> solid_queue:install` again, then give that user back the files the service may have created as root ([#13](https://github.com/codeur/capistrano-solid_queue/pull/13), from [#6](https://github.com/codeur/capistrano-solid_queue/pull/6) by [@floriancrusius](https://github.com/floriancrusius)).
|
|
19
|
+
- The service description names the application and the stage ([#13](https://github.com/codeur/capistrano-solid_queue/pull/13)).
|
|
20
|
+
- Deploys no longer run `solid_queue:quiet` after `deploy:starting`. Solid Queue has no quiet mode: the `SIGTERM` it sends starts a shutdown, so jobs stopped for the whole deploy. The service is now stopped after `deploy:updated` and started after `deploy:published` ([#15](https://github.com/codeur/capistrano-solid_queue/pull/15)).
|
|
21
|
+
- Ruby 3.1 or later is required ([#15](https://github.com/codeur/capistrano-solid_queue/pull/15)).
|
|
22
|
+
- Capistrano 3.5 or later is required: `Capistrano::Plugin` doesn't exist before ([#15](https://github.com/codeur/capistrano-solid_queue/pull/15)).
|
|
23
|
+
- The service starts Solid Queue with `bin/jobs`, as Solid Queue documents, instead of `rake solid_queue:start`. The application needs `bin/jobs`: Rails 8 applications have it, and `bin/rails solid_queue:install` creates it. Run `cap <stage> solid_queue:install` again to update an installed service ([#16](https://github.com/codeur/capistrano-solid_queue/pull/16)).
|
|
24
|
+
|
|
25
|
+
### Removed
|
|
26
|
+
|
|
27
|
+
- `solid_queue:reload` and the `ExecReload=` line of the service: the `SIGTSTP` it sent didn't reload Solid Queue ([#15](https://github.com/codeur/capistrano-solid_queue/pull/15)).
|
|
28
|
+
- `solid_queue:quiet`: Solid Queue has no quiet mode, the `SIGTERM` it sent started a shutdown. `solid_queue:stop` stops Solid Queue gracefully ([#16](https://github.com/codeur/capistrano-solid_queue/pull/16)).
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- In `:system` mode, `solid_queue:install` and `solid_queue:uninstall` work when Capistrano doesn't connect as root: the unit is uploaded to `:tmp_dir`, then moved and removed with `sudo` ([#15](https://github.com/codeur/capistrano-solid_queue/pull/15)).
|
|
33
|
+
- `solid_queue:install` enables the service on each server right after uploading its unit there, instead of running `solid_queue:enable` on every server from the first one ([#15](https://github.com/codeur/capistrano-solid_queue/pull/15)).
|
|
34
|
+
- `solid_queue:uninstall` removes only the unit of the service, not every file whose name starts with it ([#15](https://github.com/codeur/capistrano-solid_queue/pull/15)).
|
|
35
|
+
- `solid_queue:status` shows the status of a stopped service instead of failing ([#15](https://github.com/codeur/capistrano-solid_queue/pull/15)).
|
|
36
|
+
- The README lists the hooks the plugin registers ([#14](https://github.com/codeur/capistrano-solid_queue/pull/14)), tells to enable lingering for user services, and links to the right code of conduct ([#15](https://github.com/codeur/capistrano-solid_queue/pull/15)).
|
|
37
|
+
- The README says when the gem isn't needed (Solid Queue running inside Puma) and how to pass `bin/jobs` options ([#16](https://github.com/codeur/capistrano-solid_queue/pull/16)).
|
|
38
|
+
- The gem's changelog link points to this file, and the gem no longer ships its outdated RBS signature, `.standard.yml` and `Rakefile` ([#15](https://github.com/codeur/capistrano-solid_queue/pull/15)).
|
|
39
|
+
|
|
9
40
|
## [0.1.3] - 2026-11-09
|
|
10
41
|
|
|
11
42
|
### Fixed
|
|
@@ -33,7 +64,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
33
64
|
|
|
34
65
|
- Initial release.
|
|
35
66
|
|
|
36
|
-
[unreleased]: https://github.com/codeur/capistrano-solid_queue/compare/v0.
|
|
67
|
+
[unreleased]: https://github.com/codeur/capistrano-solid_queue/compare/v0.2.0...HEAD
|
|
68
|
+
[0.2.0]: https://github.com/codeur/capistrano-solid_queue/compare/v0.1.3...v0.2.0
|
|
37
69
|
[0.1.3]: https://github.com/codeur/capistrano-solid_queue/compare/v0.1.2...v0.1.3
|
|
38
70
|
[0.1.2]: https://github.com/codeur/capistrano-solid_queue/compare/v0.1.1...v0.1.2
|
|
39
71
|
[0.1.1]: https://github.com/codeur/capistrano-solid_queue/compare/v0.1.0...v0.1.1
|
data/README.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# Capistrano Systemd integration for SolidQueue
|
|
2
2
|
|
|
3
|
+
Runs [Solid Queue](https://github.com/rails/solid_queue) in its own process, with `bin/jobs`, as a systemd service. The application needs `bin/jobs`: Rails 8 applications have it, and `bin/rails solid_queue:install` creates it. If Solid Queue runs inside Puma with its plugin (`plugin :solid_queue`), you don't need this gem: both would start a Solid Queue supervisor.
|
|
4
|
+
|
|
3
5
|
Adds the following capistrano commands:
|
|
4
6
|
|
|
5
7
|
```sh
|
|
6
|
-
solid_queue:
|
|
7
|
-
solid_queue:
|
|
8
|
-
solid_queue:
|
|
9
|
-
solid_queue:install
|
|
10
|
-
solid_queue:
|
|
11
|
-
solid_queue:
|
|
12
|
-
solid_queue:
|
|
13
|
-
solid_queue:
|
|
14
|
-
solid_queue:
|
|
15
|
-
solid_queue:stop # Stop solid_queue service via systemd
|
|
16
|
-
solid_queue:uninstall # Uninstall solid_queue systemd service
|
|
8
|
+
cap solid_queue:disable # Disable solid_queue systemd service
|
|
9
|
+
cap solid_queue:enable # Enable solid_queue systemd service
|
|
10
|
+
cap solid_queue:generate # Generate solid_queue systemd service
|
|
11
|
+
cap solid_queue:install # Install solid_queue systemd service
|
|
12
|
+
cap solid_queue:restart # Restart solid_queue service via systemd
|
|
13
|
+
cap solid_queue:start # Start solid_queue service via systemd
|
|
14
|
+
cap solid_queue:status # Get solid_queue service status via systemd
|
|
15
|
+
cap solid_queue:stop # Stop solid_queue service via systemd
|
|
16
|
+
cap solid_queue:uninstall # Uninstall solid_queue systemd service
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
|
|
@@ -53,23 +53,82 @@ bundle exec cap production solid_queue:install
|
|
|
53
53
|
|
|
54
54
|
for the initial setup. This will copy a [`systemd` service definition](lib/capistrano/templates/solid_queue.service.erb) to `~/.config/systemd/user/<application>_solid_queue_<stage>.service` on your server marked with Capistrano role `db`.
|
|
55
55
|
|
|
56
|
-
It will also `enable` it in `systemd`,
|
|
56
|
+
It will also `enable` it in `systemd`, so that you can then run commands such as:
|
|
57
57
|
|
|
58
58
|
```sh
|
|
59
59
|
systemctl --user status your_app_solid_queue_production
|
|
60
60
|
systemctl --user start your_app_solid_queue_production
|
|
61
61
|
systemctl --user stop your_app_solid_queue_production
|
|
62
|
-
systemctl --user reload your_app_solid_queue_production
|
|
63
62
|
systemctl --user restart your_app_solid_queue_production
|
|
64
63
|
```
|
|
65
64
|
|
|
66
|
-
through their Capistrano counterparts, ex: `bundle exec cap solid_queue:restart`.
|
|
65
|
+
through their Capistrano counterparts, ex: `bundle exec cap production solid_queue:restart`.
|
|
66
|
+
|
|
67
|
+
A user service only runs while its user has a session open on the server, unless lingering is enabled for that user. Enable it once on each server, with the user Capistrano connects with:
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
sudo loginctl enable-linger deploy
|
|
71
|
+
```
|
|
67
72
|
|
|
68
73
|
## Usage
|
|
69
74
|
|
|
70
|
-
The plugin
|
|
75
|
+
The plugin registers these Capistrano hooks:
|
|
76
|
+
|
|
77
|
+
- after `deploy:updated`, `solid_queue:stop` stops the service;
|
|
78
|
+
- after `deploy:published`, `solid_queue:start` starts the service on the new release;
|
|
79
|
+
- after `deploy:failed`, `solid_queue:restart` restarts the service.
|
|
80
|
+
|
|
71
81
|
See [`#register_hooks`](lib/capistrano/solid_queue.rb)
|
|
72
82
|
|
|
83
|
+
## Configuration
|
|
84
|
+
|
|
85
|
+
These variables can be set in `config/deploy.rb` or in a stage file. The values below are the defaults.
|
|
86
|
+
|
|
87
|
+
```ruby
|
|
88
|
+
set :solid_queue_role, "db"
|
|
89
|
+
set :solid_queue_access_log, -> { File.join(shared_path, "log", "solid_queue.log") }
|
|
90
|
+
set :solid_queue_error_log, -> { File.join(shared_path, "log", "solid_queue.log") }
|
|
91
|
+
set :solid_queue_service_unit_name, -> { "#{fetch(:application)}_solid_queue_#{fetch(:stage)}" }
|
|
92
|
+
set :solid_queue_service_unit_env_vars, -> { fetch(:service_unit_env_vars, []) }
|
|
93
|
+
set :solid_queue_service_unit_env_files, -> { fetch(:service_unit_env_files, []) }
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
After changing any of them, run `cap <stage> solid_queue:install` again: deploys don't regenerate the service.
|
|
97
|
+
|
|
98
|
+
### User or system service
|
|
99
|
+
|
|
100
|
+
By default, Solid Queue runs as a user service: `systemctl --user`, with the unit file in `~/.config/systemd/user`. To run it as a system service instead:
|
|
101
|
+
|
|
102
|
+
```ruby
|
|
103
|
+
set :solid_queue_systemctl_user, :system
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
The unit file then goes to `/etc/systemd/system/`, `systemctl` runs through `sudo`, and the service runs as the user Capistrano connects with. `:solid_queue_systemd_conf_dir` sets another directory for the unit file.
|
|
107
|
+
|
|
108
|
+
### Environment
|
|
109
|
+
|
|
110
|
+
The service gets these variables, in this order:
|
|
111
|
+
|
|
112
|
+
1. `RAILS_ENV`, from `:rails_env`, or from `:stage` when `:rails_env` isn't set.
|
|
113
|
+
2. Capistrano's `default_env`, except `PATH`. Each value is expanded by the server shell, as in Capistrano commands (`$HOME`…).
|
|
114
|
+
3. `MALLOC_ARENA_MAX=2`.
|
|
115
|
+
4. `:solid_queue_service_unit_env_vars`, written as is in `Environment="…"` lines.
|
|
116
|
+
|
|
117
|
+
A later line overrides an earlier one, so `:solid_queue_service_unit_env_vars` can override any of the above. The files of `:solid_queue_service_unit_env_files` (`EnvironmentFile=` lines) override all of them. systemd doesn't start the service when one of these files is missing, unless its path starts with `-`.
|
|
118
|
+
|
|
119
|
+
```ruby
|
|
120
|
+
set :solid_queue_service_unit_env_vars, ["MALLOC_ARENA_MAX=4"]
|
|
121
|
+
set :solid_queue_service_unit_env_files, ["/var/www/my_app/shared/.env", "-/etc/default/my_app"]
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
When they aren't set, the `:service_unit_env_vars` and `:service_unit_env_files` variables, also read by capistrano3-puma and capistrano-sidekiq, are used.
|
|
125
|
+
|
|
126
|
+
Solid Queue reads the options of `bin/jobs` from environment variables too, for instance:
|
|
127
|
+
|
|
128
|
+
```ruby
|
|
129
|
+
set :solid_queue_service_unit_env_vars, ["SOLID_QUEUE_CONFIG=config/calendar.yml", "SOLID_QUEUE_SKIP_RECURRING=true"]
|
|
130
|
+
```
|
|
131
|
+
|
|
73
132
|
## Development
|
|
74
133
|
|
|
75
134
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
@@ -86,7 +145,7 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
|
86
145
|
|
|
87
146
|
## Code of Conduct
|
|
88
147
|
|
|
89
|
-
Everyone interacting in the Capistrano::SolidQueue project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
|
148
|
+
Everyone interacting in the Capistrano::SolidQueue project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/codeur/capistrano-solid_queue/blob/main/CODE_OF_CONDUCT.md).
|
|
90
149
|
|
|
91
150
|
## Credits
|
|
92
151
|
|
|
@@ -11,6 +11,8 @@ module Capistrano
|
|
|
11
11
|
set_if_empty :solid_queue_error_log, -> { File.join(shared_path, "log", "solid_queue.log") }
|
|
12
12
|
set_if_empty :solid_queue_service_unit_name, -> { "#{fetch(:application)}_solid_queue_#{fetch(:stage)}" }
|
|
13
13
|
set_if_empty :solid_queue_systemd_conf_dir, -> { fetch_systemd_unit_path }
|
|
14
|
+
set_if_empty :solid_queue_service_unit_env_vars, -> { fetch(:service_unit_env_vars, []) }
|
|
15
|
+
set_if_empty :solid_queue_service_unit_env_files, -> { fetch(:service_unit_env_files, []) }
|
|
14
16
|
end
|
|
15
17
|
|
|
16
18
|
def define_tasks
|
|
@@ -18,12 +20,19 @@ module Capistrano
|
|
|
18
20
|
end
|
|
19
21
|
|
|
20
22
|
def register_hooks
|
|
21
|
-
after "deploy:starting", "solid_queue:quiet"
|
|
22
23
|
after "deploy:updated", "solid_queue:stop"
|
|
23
24
|
after "deploy:published", "solid_queue:start"
|
|
24
25
|
after "deploy:failed", "solid_queue:restart"
|
|
25
26
|
end
|
|
26
27
|
|
|
28
|
+
def service_unit(context)
|
|
29
|
+
ERB.new(File.read(File.expand_path("templates/solid_queue.service.erb", __dir__)), trim_mode: "-").result(context)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def service_unit_file
|
|
33
|
+
"#{fetch(:solid_queue_service_unit_name)}.service"
|
|
34
|
+
end
|
|
35
|
+
|
|
27
36
|
def execute_systemd(*args, raise_on_non_zero_exit: true)
|
|
28
37
|
sudo_if_needed(*systemd_command(*args), raise_on_non_zero_exit: raise_on_non_zero_exit)
|
|
29
38
|
end
|
|
@@ -5,41 +5,29 @@ plugin = self
|
|
|
5
5
|
namespace :solid_queue do # rubocop:disable Metrics
|
|
6
6
|
desc "Generate solid_queue systemd service"
|
|
7
7
|
task :generate do
|
|
8
|
-
on roles(fetch(:solid_queue_role)) do
|
|
9
|
-
|
|
10
|
-
erb = File.read(service_file)
|
|
11
|
-
File.write "solid_queue.service", ERB.new(erb, trim_mode: "-").result(binding)
|
|
8
|
+
on roles(fetch(:solid_queue_role)) do
|
|
9
|
+
File.write "solid_queue.service", plugin.service_unit(binding)
|
|
12
10
|
end
|
|
13
11
|
end
|
|
14
12
|
|
|
15
13
|
desc "Install solid_queue systemd service"
|
|
16
14
|
task :install do
|
|
17
|
-
on roles(fetch(:solid_queue_role)) do
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
file = StringIO.new(ERB.new(erb, trim_mode: "-").result(binding))
|
|
23
|
-
|
|
24
|
-
systemd_path = fetch(:solid_queue_systemd_conf_dir)
|
|
25
|
-
path = "#{systemd_path}/#{fetch(:solid_queue_service_unit_name)}.service"
|
|
26
|
-
|
|
27
|
-
execute :mkdir, "-p", systemd_path
|
|
28
|
-
upload! file, path
|
|
15
|
+
on roles(fetch(:solid_queue_role)) do
|
|
16
|
+
tmp_path = File.join(fetch(:tmp_dir), plugin.service_unit_file)
|
|
17
|
+
upload! StringIO.new(plugin.service_unit(binding)), tmp_path
|
|
18
|
+
plugin.sudo_if_needed("mkdir", "-p", fetch(:solid_queue_systemd_conf_dir))
|
|
19
|
+
plugin.sudo_if_needed("mv", tmp_path, File.join(fetch(:solid_queue_systemd_conf_dir), plugin.service_unit_file))
|
|
29
20
|
|
|
30
|
-
# Reload systemd
|
|
31
21
|
plugin.execute_systemd("daemon-reload")
|
|
32
|
-
|
|
22
|
+
plugin.execute_systemd("enable", fetch(:solid_queue_service_unit_name))
|
|
33
23
|
end
|
|
34
24
|
end
|
|
35
25
|
|
|
36
26
|
desc "Uninstall solid_queue systemd service"
|
|
37
27
|
task :uninstall do
|
|
38
28
|
invoke "solid_queue:disable"
|
|
39
|
-
on roles(fetch(:solid_queue_role)) do
|
|
40
|
-
|
|
41
|
-
execute :rm, "-f", "#{systemd_path}/#{fetch(:solid_queue_service_unit_name)}*"
|
|
42
|
-
|
|
29
|
+
on roles(fetch(:solid_queue_role)) do
|
|
30
|
+
plugin.sudo_if_needed("rm", "-f", File.join(fetch(:solid_queue_systemd_conf_dir), plugin.service_unit_file))
|
|
43
31
|
plugin.execute_systemd("daemon-reload")
|
|
44
32
|
end
|
|
45
33
|
end
|
|
@@ -58,13 +46,6 @@ namespace :solid_queue do # rubocop:disable Metrics
|
|
|
58
46
|
end
|
|
59
47
|
end
|
|
60
48
|
|
|
61
|
-
desc "Quiet solid_queue (start graceful termination)"
|
|
62
|
-
task :quiet do
|
|
63
|
-
on roles(fetch(:solid_queue_role)) do
|
|
64
|
-
plugin.execute_systemd("kill", "-s", "SIGTERM", fetch(:solid_queue_service_unit_name), raise_on_non_zero_exit: false)
|
|
65
|
-
end
|
|
66
|
-
end
|
|
67
|
-
|
|
68
49
|
desc "Start solid_queue service via systemd"
|
|
69
50
|
task :start do
|
|
70
51
|
on roles(fetch(:solid_queue_role)) do
|
|
@@ -86,17 +67,10 @@ namespace :solid_queue do # rubocop:disable Metrics
|
|
|
86
67
|
end
|
|
87
68
|
end
|
|
88
69
|
|
|
89
|
-
desc "Reload solid_queue service via systemd"
|
|
90
|
-
task :reload do
|
|
91
|
-
on roles(fetch(:solid_queue_role)) do
|
|
92
|
-
plugin.execute_systemd("reload", fetch(:solid_queue_service_unit_name))
|
|
93
|
-
end
|
|
94
|
-
end
|
|
95
|
-
|
|
96
70
|
desc "Get solid_queue service status via systemd"
|
|
97
71
|
task :status do
|
|
98
72
|
on roles(fetch(:solid_queue_role)) do
|
|
99
|
-
plugin.execute_systemd("status", fetch(:solid_queue_service_unit_name))
|
|
73
|
+
plugin.execute_systemd("status", fetch(:solid_queue_service_unit_name), raise_on_non_zero_exit: false)
|
|
100
74
|
end
|
|
101
75
|
end
|
|
102
76
|
end
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
[Unit]
|
|
2
|
-
Description=SolidQueue background job
|
|
2
|
+
Description=SolidQueue background job for <%= fetch(:application) %> (<%= fetch(:stage) %>)
|
|
3
3
|
After=syslog.target network.target
|
|
4
4
|
|
|
5
5
|
[Service]
|
|
6
6
|
Type=simple
|
|
7
|
+
<% if fetch(:solid_queue_systemctl_user) == :system -%>
|
|
8
|
+
User=<%= capture(:id, "-un") %>
|
|
9
|
+
<% end -%>
|
|
7
10
|
Environment='RAILS_ENV=<%= fetch(:rails_env, fetch(:stage)) %>'
|
|
8
11
|
<% fetch(:default_env).reject{ |k, _| k.to_s == 'path' }.each do |variable, value| -%>
|
|
9
12
|
Environment='<%= variable.to_s.upcase %>=<%= capture(:printf, "%s", %("#{value.to_s.gsub('"', '\"')}")) %>'
|
|
10
13
|
<% end -%>
|
|
11
14
|
WorkingDirectory=<%= current_path %>
|
|
12
|
-
ExecStart=<%= capture(:echo, SSHKit.config.command_map[:bundle]).strip %> exec
|
|
13
|
-
ExecReload=/bin/kill -TSTP $MAINPID
|
|
15
|
+
ExecStart=<%= capture(:echo, SSHKit.config.command_map[:bundle]).strip %> exec bin/jobs
|
|
14
16
|
ExecStop=/bin/kill -TERM $MAINPID
|
|
15
17
|
Environment=MALLOC_ARENA_MAX=2
|
|
18
|
+
<% fetch(:solid_queue_service_unit_env_vars).each do |variable| -%>
|
|
19
|
+
Environment="<%= variable %>"
|
|
20
|
+
<% end -%>
|
|
21
|
+
<% fetch(:solid_queue_service_unit_env_files).each do |file| -%>
|
|
22
|
+
EnvironmentFile=<%= file %>
|
|
23
|
+
<% end -%>
|
|
16
24
|
|
|
17
25
|
# if we crash, restart
|
|
18
26
|
RestartSec=1
|
metadata
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: capistrano-solid_queue
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brice TEXIER
|
|
8
|
-
bindir:
|
|
8
|
+
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
@@ -15,32 +15,30 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: '3.
|
|
18
|
+
version: '3.5'
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: '3.
|
|
26
|
-
description:
|
|
25
|
+
version: '3.5'
|
|
26
|
+
description: Capistrano tasks and deploy hooks that install, start, stop and restart
|
|
27
|
+
Solid Queue as a systemd service.
|
|
27
28
|
email:
|
|
28
29
|
- brice@codeur.com
|
|
29
30
|
executables: []
|
|
30
31
|
extensions: []
|
|
31
32
|
extra_rdoc_files: []
|
|
32
33
|
files:
|
|
33
|
-
- ".standard.yml"
|
|
34
34
|
- CHANGELOG.md
|
|
35
35
|
- CODE_OF_CONDUCT.md
|
|
36
36
|
- LICENSE.txt
|
|
37
37
|
- README.md
|
|
38
|
-
- Rakefile
|
|
39
38
|
- lib/capistrano/solid_queue.rb
|
|
40
39
|
- lib/capistrano/solid_queue/version.rb
|
|
41
40
|
- lib/capistrano/tasks/solid_queue.rake
|
|
42
41
|
- lib/capistrano/templates/solid_queue.service.erb
|
|
43
|
-
- sig/capistrano/solid_queue.rbs
|
|
44
42
|
homepage: https://github.com/codeur/capistrano-solid_queue
|
|
45
43
|
licenses:
|
|
46
44
|
- MIT
|
|
@@ -48,7 +46,7 @@ metadata:
|
|
|
48
46
|
allowed_push_host: https://rubygems.org
|
|
49
47
|
homepage_uri: https://github.com/codeur/capistrano-solid_queue
|
|
50
48
|
source_code_uri: https://github.com/codeur/capistrano-solid_queue
|
|
51
|
-
changelog_uri: https://github.com/codeur/capistrano-solid_queue/
|
|
49
|
+
changelog_uri: https://github.com/codeur/capistrano-solid_queue/blob/main/CHANGELOG.md
|
|
52
50
|
rdoc_options: []
|
|
53
51
|
require_paths:
|
|
54
52
|
- lib
|
|
@@ -56,7 +54,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
56
54
|
requirements:
|
|
57
55
|
- - ">="
|
|
58
56
|
- !ruby/object:Gem::Version
|
|
59
|
-
version:
|
|
57
|
+
version: 3.1.0
|
|
60
58
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
61
59
|
requirements:
|
|
62
60
|
- - ">="
|
|
@@ -65,5 +63,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
65
63
|
requirements: []
|
|
66
64
|
rubygems_version: 4.0.16
|
|
67
65
|
specification_version: 4
|
|
68
|
-
summary:
|
|
66
|
+
summary: Run Solid Queue as a systemd service with Capistrano
|
|
69
67
|
test_files: []
|
data/.standard.yml
DELETED
data/Rakefile
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "bundler/gem_tasks"
|
|
4
|
-
require "minitest/test_task"
|
|
5
|
-
|
|
6
|
-
Minitest::TestTask.create do |t|
|
|
7
|
-
# Capistrano 3.20 emits circular require warnings under Ruby 3.4 with -w.
|
|
8
|
-
# Keep test output clean until upstream fixes the warning path.
|
|
9
|
-
t.warning = false
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
require "standard/rake"
|
|
13
|
-
|
|
14
|
-
task default: %i[test standard]
|