tomo-plugin-sidekiq 0.1.0 → 1.0.2

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: f3303d6ffcaaa101d28fd1e3febfae1c6b7c8e9cfff5940bfc8317b1a38ca8bb
4
- data.tar.gz: ef8a62f99fb77781510bec581b9f3d72b5272c42869695c68e5c75c3936a5473
3
+ metadata.gz: c961bfaa5cdf2475c09ff03ea87e75fe68ddfcbf87b0b50794e4e73ee8376a16
4
+ data.tar.gz: 85bb892c868ec53df6477245460fc1bc0b30e6261297e081069af9cc72fc32da
5
5
  SHA512:
6
- metadata.gz: c567215b96ffc0f723ab93532f3ef167fd4904132e00d693bdb0f5fe997746fb3e5f08e6c6973bb21bc164686df9e2fe6a86f4668cfb3f6586f710844634b993
7
- data.tar.gz: 1fac066c500134c43872d0db603f8be576d8393ac3fa747c124c166e4f7162b29fc5dd08a167b907dc579551a70b45ca77e1e1a36aafa96bb37b5712119a5df0
6
+ metadata.gz: cce4f551031a8953bdb18b8d23e3607aaaf65888ce12a3a5e03fee74680aa3268ddebd6aa29507b7f9ce11ba6206caec58816deb578b10aba5d8086e97967fa3
7
+ data.tar.gz: ae9f55db2be6608b0c9d312a99a158530d9756eda159b7fd1487533f5d3eb92fdad5e2a72979d1ed8ca481b228445bb1a6f31d94d20608e00f046a305a232557
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2019 Matt Brictson
3
+ Copyright (c) 2020 Matt Brictson
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/tomo-plugin-sidekiq.svg)](https://rubygems.org/gems/tomo-plugin-sidekiq)
4
4
  [![Travis](https://img.shields.io/travis/mattbrictson/tomo-plugin-sidekiq.svg?label=travis)](https://travis-ci.org/mattbrictson/tomo-plugin-sidekiq)
5
- [![Circle](https://circleci.com/gh/mattbrictson/tomo-plugin-sidekiq.svg?style=shield)](https://circleci.com/gh/mattbrictson/tomo-plugin-sidekiq)
5
+ [![Circle](https://circleci.com/gh/mattbrictson/tomo-plugin-sidekiq/tree/main.svg?style=shield)](https://app.circleci.com/pipelines/github/mattbrictson/tomo-plugin-sidekiq?branch=main)
6
6
  [![Code Climate](https://codeclimate.com/github/mattbrictson/tomo-plugin-sidekiq/badges/gpa.svg)](https://codeclimate.com/github/mattbrictson/tomo-plugin-sidekiq)
7
7
 
8
8
  This is a [tomo](https://github.com/mattbrictson/tomo) plugin that provides tasks for managing [sidekiq](https://github.com/mperham/sidekiq) via [systemd](https://en.wikipedia.org/wiki/Systemd), based on the recommendations in the sidekiq documentation. This plugin assumes that you are also using the tomo `rbenv` and `env` plugins, and that you are using a systemd-based Linux distribution like Ubuntu 18 LTS.
@@ -12,6 +12,7 @@ This is a [tomo](https://github.com/mattbrictson/tomo) plugin that provides task
12
12
  - [Installation](#installation)
13
13
  - [Settings](#settings)
14
14
  - [Tasks](#tasks)
15
+ - [Recommendations](#recommendations)
15
16
  - [Support](#support)
16
17
  - [License](#license)
17
18
  - [Code of conduct](#code-of-conduct)
@@ -63,7 +64,7 @@ $ loginctl enable-linger <DEPLOY_USER>
63
64
  | --------------------- | ------- |
64
65
  | `sidekiq_systemd_service` | Name of the systemd unit that will be used to manage sidekiq <br>**Default:** `"sidekiq_%{application}.service"` |
65
66
  | `sidekiq_systemd_service_path` | Location where the systemd unit will be installed <br>**Default:** `".config/systemd/user/%{sidekiq_systemd_service}"` |
66
- | `sidekiq_systemd_service_template_path` | Local path to the ERB template that will be used to create the systemd unit <br>**Default:** [service.erb](https://github.com/mattbrictson/tomo-plugin-sidekiq/blob/master/lib/tomo/plugin/sidekiq/service.erb) |
67
+ | `sidekiq_systemd_service_template_path` | Local path to the ERB template that will be used to create the systemd unit <br>**Default:** [service.erb](https://github.com/mattbrictson/tomo-plugin-sidekiq/blob/main/lib/tomo/plugin/sidekiq/service.erb) |
67
68
 
68
69
  ## Tasks
69
70
 
@@ -135,6 +136,8 @@ Add a `config/sidekiq.yml` file to your application (i.e. checked into git) and
135
136
  :queues:
136
137
  - default
137
138
  - mailers
139
+ - active_storage_analysis
140
+ - active_storage_purge
138
141
 
139
142
  :concurrency: <%= ENV.fetch("SIDEKIQ_CONCURRENCY", "1") %>
140
143
  ```
@@ -1,19 +1,12 @@
1
1
  require "tomo"
2
- require "tomo/plugin/sidekiq/tasks"
3
- require "tomo/plugin/sidekiq/version"
2
+ require_relative "sidekiq/tasks"
3
+ require_relative "sidekiq/version"
4
4
 
5
- module Tomo
6
- module Plugin
7
- module Sidekiq
8
- extend Tomo::PluginDSL
5
+ module Tomo::Plugin::Sidekiq
6
+ extend Tomo::PluginDSL
9
7
 
10
- tasks Tomo::Plugin::Sidekiq::Tasks
11
-
12
- # rubocop:disable Metrics/LineLength
13
- defaults sidekiq_systemd_service: "sidekiq_%{application}.service",
14
- sidekiq_systemd_service_path: ".config/systemd/user/%{sidekiq_systemd_service}",
15
- sidekiq_systemd_service_template_path: File.expand_path("sidekiq/service.erb", __dir__)
16
- # rubocop:enable Metrics/LineLength
17
- end
18
- end
8
+ tasks Tomo::Plugin::Sidekiq::Tasks
9
+ defaults sidekiq_systemd_service: "sidekiq_%{application}.service",
10
+ sidekiq_systemd_service_path: ".config/systemd/user/%{sidekiq_systemd_service}",
11
+ sidekiq_systemd_service_template_path: File.expand_path("sidekiq/service.erb", __dir__)
19
12
  end
@@ -19,4 +19,4 @@ WorkingDirectory=<%= paths.current %>
19
19
  Environment=MALLOC_ARENA_MAX=2
20
20
 
21
21
  [Install]
22
- WantedBy=multi-user.target
22
+ WantedBy=default.target
@@ -2,7 +2,6 @@ module Tomo::Plugin::Sidekiq
2
2
  class Tasks < Tomo::TaskLibrary
3
3
  SystemdUnit = Struct.new(:name, :template, :path)
4
4
 
5
- # rubocop:disable Metrics/AbcSize
6
5
  def setup_systemd
7
6
  linger_must_be_enabled!
8
7
 
@@ -12,7 +11,6 @@ module Tomo::Plugin::Sidekiq
12
11
  remote.run "systemctl --user daemon-reload"
13
12
  remote.run "systemctl", "--user", "enable", service.name
14
13
  end
15
- # rubocop:enable Metrics/AbcSize
16
14
 
17
15
  %i[reload restart start stop status].each do |action|
18
16
  define_method(action) do
@@ -21,9 +19,7 @@ module Tomo::Plugin::Sidekiq
21
19
  end
22
20
 
23
21
  def log
24
- remote.attach "journalctl", "-q",
25
- raw("--user-unit=#{service.name.shellescape}"),
26
- *settings[:run_args]
22
+ remote.attach "journalctl", "-q", raw("--user-unit=#{service.name.shellescape}"), *settings[:run_args]
27
23
  end
28
24
 
29
25
  private
@@ -37,8 +33,8 @@ module Tomo::Plugin::Sidekiq
37
33
  end
38
34
 
39
35
  def linger_must_be_enabled!
40
- loginctl_result = remote.run "loginctl", "user-status", remote.host.user
41
- return unless loginctl_result.stdout.match?(/^\s*Linger:\s*no\s*$/i)
36
+ linger_users = remote.list_files("/var/lib/systemd/linger", raise_on_error: false)
37
+ return if dry_run? || linger_users.include?(remote.host.user)
42
38
 
43
39
  die <<~ERROR.strip
44
40
  Linger must be enabled for the #{remote.host.user} user in order for
@@ -1,7 +1,8 @@
1
1
  module Tomo
2
2
  module Plugin
3
- module Sidekiq
4
- VERSION = "0.1.0".freeze
5
- end
6
3
  end
7
4
  end
5
+
6
+ module Tomo::Plugin::Sidekiq
7
+ VERSION = "1.0.2".freeze
8
+ end
metadata CHANGED
@@ -1,128 +1,30 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tomo-plugin-sidekiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Brictson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-25 00:00:00.000000000 Z
11
+ date: 2020-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tomo
15
15
  requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: 0.9.0
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: 0.9.0
27
- - !ruby/object:Gem::Dependency
28
- name: bundler
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '2.0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '2.0'
41
- - !ruby/object:Gem::Dependency
42
- name: minitest
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '5.11'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '5.11'
55
- - !ruby/object:Gem::Dependency
56
- name: minitest-ci
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '3.4'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
16
  requirements:
66
17
  - - "~>"
67
18
  - !ruby/object:Gem::Version
68
- version: '3.4'
69
- - !ruby/object:Gem::Dependency
70
- name: minitest-reporters
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '1.3'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '1.3'
83
- - !ruby/object:Gem::Dependency
84
- name: rake
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '13.0'
90
- type: :development
19
+ version: '1.0'
20
+ type: :runtime
91
21
  prerelease: false
92
22
  version_requirements: !ruby/object:Gem::Requirement
93
23
  requirements:
94
24
  - - "~>"
95
25
  - !ruby/object:Gem::Version
96
- version: '13.0'
97
- - !ruby/object:Gem::Dependency
98
- name: rubocop
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - '='
102
- - !ruby/object:Gem::Version
103
- version: 0.75.1
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - '='
109
- - !ruby/object:Gem::Version
110
- version: 0.75.1
111
- - !ruby/object:Gem::Dependency
112
- name: rubocop-performance
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - '='
116
- - !ruby/object:Gem::Version
117
- version: 1.5.0
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - '='
123
- - !ruby/object:Gem::Version
124
- version: 1.5.0
125
- description:
26
+ version: '1.0'
27
+ description:
126
28
  email:
127
29
  - opensource@mattbrictson.com
128
30
  executables: []
@@ -143,7 +45,7 @@ metadata:
143
45
  changelog_uri: https://github.com/mattbrictson/tomo-plugin-sidekiq/releases
144
46
  source_code_uri: https://github.com/mattbrictson/tomo-plugin-sidekiq
145
47
  homepage_uri: https://github.com/mattbrictson/tomo-plugin-sidekiq
146
- post_install_message:
48
+ post_install_message:
147
49
  rdoc_options: []
148
50
  require_paths:
149
51
  - lib
@@ -151,15 +53,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
151
53
  requirements:
152
54
  - - ">="
153
55
  - !ruby/object:Gem::Version
154
- version: 2.4.0
56
+ version: 2.5.0
155
57
  required_rubygems_version: !ruby/object:Gem::Requirement
156
58
  requirements:
157
59
  - - ">="
158
60
  - !ruby/object:Gem::Version
159
61
  version: '0'
160
62
  requirements: []
161
- rubygems_version: 3.0.6
162
- signing_key:
63
+ rubygems_version: 3.1.4
64
+ signing_key:
163
65
  specification_version: 4
164
66
  summary: sidekiq tasks for tomo
165
67
  test_files: []