jobly 0.2.5 → 0.2.6
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/README.md +6 -3
- data/lib/jobly/commands/config.rb +2 -1
- data/lib/jobly/job.rb +3 -0
- data/lib/jobly/job_extensions/shell.rb +11 -0
- data/lib/jobly/job_extensions/slack.rb +45 -0
- data/lib/jobly/module_functions.rb +3 -0
- data/lib/jobly/version.rb +1 -1
- metadata +32 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a7926c9fb8795e011f9580a3f56a11cdab1c2107204a93e7b831d6bfa0953a3
|
4
|
+
data.tar.gz: 41e7bc1e01dfeaf5bb20b3aff721585fa4e75cbbd55215eb7b6f6769ea736741
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afd149cf0b665da6791b77bba10c7a6c72d0510f2c2721b4c383427876b1a00749c7ae472cd476801a5ac8fc74d6f4c1846d7f738983720aced8a1f5a551165c
|
7
|
+
data.tar.gz: d4b4627453c13796d584f759e523fd4f214684ec7d02e2eb205dd87752145b60b30553d3c8ebb5a9a13d308e7f62b0b0a9c254c2a938942b7b57c9e32f2dd21d
|
data/README.md
CHANGED
@@ -40,14 +40,17 @@ sidekiq backgronud jobs system. It includes the following components:
|
|
40
40
|
and for running jobs.
|
41
41
|
- **Web API** - for executing jobs.
|
42
42
|
- **Web Dashboard** - including job progress and status.
|
43
|
-
|
43
|
+
- **Remote Syslog Support** - send output to Papertrail or remote syslog.
|
44
|
+
- **Slack Notifications** - report job progress to Slack.
|
44
45
|
|
45
46
|
|
46
47
|
Documentation
|
47
48
|
--------------------------------------------------
|
48
49
|
|
49
|
-
Visit the [Jobly
|
50
|
+
- Visit the [Jobly documentation][1].
|
51
|
+
- Visit the [interactive demo on Katacoda][3].
|
50
52
|
|
51
53
|
|
52
54
|
[1]: https://jobly.dannyb.co
|
53
|
-
[2]: https://github.com/dannyben/docker-jobly
|
55
|
+
[2]: https://github.com/dannyben/docker-jobly
|
56
|
+
[3]: https://www.katacoda.com/dannyb/scenarios/jobly
|
@@ -10,6 +10,7 @@ module Jobly
|
|
10
10
|
def run
|
11
11
|
line "custom config file", short_config_path, !Jobly.custom_config?
|
12
12
|
Jobly.options.each do |key, value|
|
13
|
+
next unless value
|
13
14
|
if key.to_s.end_with? '_path'
|
14
15
|
line key, value, !Dir.exist?(value)
|
15
16
|
else
|
@@ -21,7 +22,7 @@ module Jobly
|
|
21
22
|
private
|
22
23
|
|
23
24
|
def short_config_path
|
24
|
-
Jobly.config_file.sub "#{Dir.pwd}", '
|
25
|
+
Jobly.config_file.sub "#{Dir.pwd}/", ''
|
25
26
|
end
|
26
27
|
|
27
28
|
def line(key, value, attention=false)
|
data/lib/jobly/job.rb
CHANGED
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'slack-notifier'
|
2
|
+
|
3
|
+
module Jobly
|
4
|
+
module JobExtensions
|
5
|
+
module Slack
|
6
|
+
def self.included(base)
|
7
|
+
base.extend ClassMethods
|
8
|
+
end
|
9
|
+
|
10
|
+
module ClassMethods
|
11
|
+
def slack_channel(channel = nil)
|
12
|
+
if channel
|
13
|
+
@slack_channel = channel
|
14
|
+
else
|
15
|
+
@slack_channel ||= Jobly.slack_channel
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def slack_user(user = nil)
|
20
|
+
if user
|
21
|
+
@slack_user = user
|
22
|
+
else
|
23
|
+
@slack_user ||= Jobly.slack_user
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def slack
|
29
|
+
@slack ||= slack!
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def slack!
|
35
|
+
raise ArgumentError, "Slack webhook is not set" unless Jobly.slack_webhook
|
36
|
+
opts = {
|
37
|
+
channel: self.class.slack_channel,
|
38
|
+
username: self.class.slack_user
|
39
|
+
}
|
40
|
+
::Slack::Notifier.new Jobly.slack_webhook, opts
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -17,6 +17,9 @@ module Jobly
|
|
17
17
|
redis_url: ENV['JOBLY_REDIS_URL'] || "redis://localhost:6379/0",
|
18
18
|
status_expiration: ENV['JOBLY_STATUS_EXPIRATION']&.to_i || 30,
|
19
19
|
jobs_namespace: ENV['JOBLY_JOBS_NAMESPACE'],
|
20
|
+
slack_channel: ENV['JOBLY_SLACK_CHANNEL'] || "#general",
|
21
|
+
slack_user: ENV['JOBLY_SLACK_USER'] || "Jobly",
|
22
|
+
slack_webhook: ENV['JOBLY_SLACK_WEBHOOK'],
|
20
23
|
log: ENV['JOBLY_LOG'],
|
21
24
|
auth: ENV['JOBLY_AUTH'],
|
22
25
|
mounts: nil,
|
data/lib/jobly/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jobly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danny Ben Shitrit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mister_bin
|
@@ -164,6 +164,34 @@ dependencies:
|
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '2.0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: tty-command
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0.8'
|
174
|
+
type: :runtime
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0.8'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: slack-notifier
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - "~>"
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '2.3'
|
188
|
+
type: :runtime
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - "~>"
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '2.3'
|
167
195
|
description: Execute background jobs and build tasks on this sidekiq-based job server
|
168
196
|
email: db@dannyben.com
|
169
197
|
executables:
|
@@ -190,6 +218,8 @@ files:
|
|
190
218
|
- lib/jobly/job.rb
|
191
219
|
- lib/jobly/job_extensions/actions.rb
|
192
220
|
- lib/jobly/job_extensions/option_accessors.rb
|
221
|
+
- lib/jobly/job_extensions/shell.rb
|
222
|
+
- lib/jobly/job_extensions/slack.rb
|
193
223
|
- lib/jobly/job_extensions/solo.rb
|
194
224
|
- lib/jobly/jobs.rb
|
195
225
|
- lib/jobly/log.rb
|