dronejob 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +7 -9
- data/README.md +3 -16
- data/bin/dronejob +0 -2
- data/dronejob.gemspec +4 -5
- data/lib/dronejob/base.rb +16 -2
- data/lib/dronejob/modules/attr_store.rb +1 -1
- data/lib/dronejob/modules/callbacks.rb +31 -0
- data/lib/dronejob/modules/core.rb +2 -46
- data/lib/dronejob/modules/git.rb +38 -0
- data/lib/dronejob/modules/log.rb +21 -3
- data/lib/dronejob/modules/options.rb +1 -1
- data/lib/dronejob/modules/params.rb +1 -1
- data/lib/dronejob/modules/phases.rb +24 -18
- data/lib/dronejob/modules/queue.rb +25 -2
- data/lib/dronejob/modules/workspace.rb +13 -11
- data/lib/dronejob/version.rb +1 -1
- metadata +32 -40
- data/lib/dronejob/modules/stateful.rb +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4945a0a8896b7c9bf4ce1f0672c086e0a9dfe956
|
4
|
+
data.tar.gz: 1b41875621ed5d31aad837edd0354c089743b9db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69466465ebaf6db5b03d0b77c461e4421385bb0abde2c90f2addb337017b6deb69850ca0a69ca6b56a01d38812fa918cc3f9f88b5d890d6073eb9671bc068fb5
|
7
|
+
data.tar.gz: 41c3a2ab4bb915018763550db1652621b0c2100f2b492c0cd93fb8bd1dbd435cb22ed21c8db59834c562d5ca8d71d409cc59a6b71322d11ccffce58dbba18d2b
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
dronejob (1.1.
|
4
|
+
dronejob (1.1.1)
|
5
5
|
activejob (~> 4.2)
|
6
|
-
bundler (
|
6
|
+
bundler (>= 1.3.0, < 2.0)
|
7
7
|
git (~> 1.2)
|
8
8
|
haml (~> 4.0)
|
9
9
|
open_uri_redirections (~> 0.2)
|
10
|
-
rake (~> 10.5)
|
11
10
|
rubyzip (~> 1.1)
|
12
|
-
sidekiq (~> 4.1
|
13
|
-
sidekiq-status (~> 0.6
|
11
|
+
sidekiq (~> 4.1)
|
12
|
+
sidekiq-status (~> 0.6)
|
14
13
|
thor (~> 0.19)
|
15
14
|
typhoeus (~> 1.0)
|
16
15
|
|
@@ -26,7 +25,7 @@ GEM
|
|
26
25
|
minitest (~> 5.1)
|
27
26
|
thread_safe (~> 0.3, >= 0.3.4)
|
28
27
|
tzinfo (~> 1.1)
|
29
|
-
coderay (1.1.
|
28
|
+
coderay (1.1.1)
|
30
29
|
concurrent-ruby (1.0.1)
|
31
30
|
connection_pool (2.2.0)
|
32
31
|
diff-lcs (1.2.5)
|
@@ -47,13 +46,12 @@ GEM
|
|
47
46
|
coderay (~> 1.1.0)
|
48
47
|
method_source (~> 0.8.1)
|
49
48
|
slop (~> 3.4)
|
50
|
-
rake (10.5.0)
|
51
49
|
redis (3.3.0)
|
52
50
|
rspec (3.4.0)
|
53
51
|
rspec-core (~> 3.4.0)
|
54
52
|
rspec-expectations (~> 3.4.0)
|
55
53
|
rspec-mocks (~> 3.4.0)
|
56
|
-
rspec-core (3.4.
|
54
|
+
rspec-core (3.4.4)
|
57
55
|
rspec-support (~> 3.4.0)
|
58
56
|
rspec-expectations (3.4.0)
|
59
57
|
diff-lcs (>= 1.2.0, < 2.0)
|
@@ -87,4 +85,4 @@ DEPENDENCIES
|
|
87
85
|
rspec (~> 3.3)
|
88
86
|
|
89
87
|
BUNDLED WITH
|
90
|
-
1.
|
88
|
+
1.12.1
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# DroneJob
|
2
2
|
|
3
3
|
Scalable worker factory for ruby
|
4
4
|
|
@@ -10,19 +10,6 @@ Install gems:
|
|
10
10
|
|
11
11
|
## Usage
|
12
12
|
|
13
|
+
List dronejob commands:
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
```ruby
|
18
|
-
# Create stdout logger
|
19
|
-
require "logging"
|
20
|
-
Logging.color_scheme("bright", levels: { debug: :blue, info: :green, warn: :yellow, error: :red, fatal: [:white, :on_red] }, date: :blue, ndc: :blue, logger: :cyan, message: :black)
|
21
|
-
Dronejob::Base.logger = Logging::Logger.new("Dronejob").add_appenders(Logging::Appenders::Stdout.new("stdout", {layout: Logging.layouts.pattern({pattern: '[%d] %-5l %c{1} %x %m\n', color_scheme: 'bright'})}))
|
22
|
-
|
23
|
-
# Create gcl logger
|
24
|
-
require "logging"
|
25
|
-
require "logging/appenders/gcl"
|
26
|
-
Logging.init(Logging::Appenders::GoogleCloudLogging::SEVERITY_NAMES)
|
27
|
-
Dronejob::Base.logger = Logging::Logger.new("Dronejob").add_appenders(Logging::Appenders::GoogleCloudLogging.new("gcl", {project_id: "project-id", log_name: "dronejob", resource_type: "gce_instance", resource_labels: {instance_id: "instance-id", zone: "us-central1-b"}, buffer_size: '3', immediate_at: 'error, fatal'}))
|
28
|
-
```
|
15
|
+
$ bundle exec dronejob
|
data/bin/dronejob
CHANGED
data/dronejob.gemspec
CHANGED
@@ -14,17 +14,16 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.description = "Scalable worker factory for ruby"
|
15
15
|
s.required_ruby_version = '~> 2.0'
|
16
16
|
s.required_rubygems_version = '~> 2.4'
|
17
|
-
s.
|
18
|
-
s.add_runtime_dependency "rake", "~> 10.5"
|
17
|
+
s.add_dependency "bundler", '>= 1.3.0', '< 2.0'
|
19
18
|
s.add_runtime_dependency "git", "~> 1.2"
|
20
19
|
s.add_runtime_dependency "thor", "~> 0.19"
|
21
|
-
s.add_runtime_dependency "sidekiq", "~> 4.1.0"
|
22
20
|
s.add_runtime_dependency "haml", "~> 4.0"
|
23
|
-
s.add_runtime_dependency "sidekiq
|
24
|
-
s.add_runtime_dependency "
|
21
|
+
s.add_runtime_dependency "sidekiq", "~> 4.1"
|
22
|
+
s.add_runtime_dependency "sidekiq-status", "~> 0.6"
|
25
23
|
s.add_runtime_dependency "rubyzip", "~> 1.1"
|
26
24
|
s.add_runtime_dependency "activejob", "~> 4.2"
|
27
25
|
s.add_runtime_dependency "typhoeus", "~> 1.0"
|
26
|
+
s.add_runtime_dependency "open_uri_redirections", "~> 0.2"
|
28
27
|
s.add_development_dependency "rspec", "~> 3.3"
|
29
28
|
s.add_development_dependency "pry", "~> 0.10"
|
30
29
|
s.files = `git ls-files`.split("\n")
|
data/lib/dronejob/base.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "active_job"
|
2
2
|
require 'dronejob/modules/attr_store'
|
3
|
+
require 'dronejob/modules/callbacks'
|
3
4
|
require 'dronejob/modules/core'
|
4
5
|
require 'dronejob/modules/git'
|
5
6
|
require 'dronejob/modules/log'
|
@@ -7,7 +8,6 @@ require 'dronejob/modules/queue'
|
|
7
8
|
require 'dronejob/modules/options'
|
8
9
|
require 'dronejob/modules/params'
|
9
10
|
require 'dronejob/modules/phases'
|
10
|
-
require 'dronejob/modules/stateful'
|
11
11
|
require 'dronejob/modules/workspace'
|
12
12
|
|
13
13
|
module Dronejob
|
@@ -15,6 +15,7 @@ module Dronejob
|
|
15
15
|
DRONEJOB_TYPE = "base"
|
16
16
|
queue_as :dronejob
|
17
17
|
include Modules::AttrStore
|
18
|
+
include Modules::Callbacks
|
18
19
|
include Modules::Core
|
19
20
|
include Modules::Git
|
20
21
|
include Modules::Log
|
@@ -22,9 +23,22 @@ module Dronejob
|
|
22
23
|
include Modules::Options
|
23
24
|
include Modules::Params
|
24
25
|
include Modules::Phases
|
25
|
-
include Modules::Stateful
|
26
26
|
include Modules::Workspace
|
27
27
|
|
28
|
+
def uuid
|
29
|
+
@uuid ||= "#{self.class.name.split('::').last.underscore}_#{SecureRandom.uuid}"
|
30
|
+
end
|
31
|
+
|
32
|
+
def title
|
33
|
+
self.class.name
|
34
|
+
end
|
35
|
+
|
36
|
+
rescue_from(Exception) do |exception|
|
37
|
+
publish_error(exception)
|
38
|
+
error(exception)
|
39
|
+
Kernel.exit!
|
40
|
+
end
|
41
|
+
|
28
42
|
ActiveSupport.run_load_hooks(:dronejob, self)
|
29
43
|
end
|
30
44
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Dronejob
|
2
|
+
module Modules
|
3
|
+
module Callbacks
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
include ActiveSupport::Callbacks
|
6
|
+
|
7
|
+
included do
|
8
|
+
define_callbacks :phase
|
9
|
+
define_callbacks :job
|
10
|
+
end
|
11
|
+
|
12
|
+
class_methods do
|
13
|
+
def before_phase(*methods, &block)
|
14
|
+
set_callback(:phase, :before, *methods, &block)
|
15
|
+
end
|
16
|
+
|
17
|
+
def after_phase(*methods, &block)
|
18
|
+
set_callback(:phase, :after, *methods, &block)
|
19
|
+
end
|
20
|
+
|
21
|
+
def before_job(*methods, &block)
|
22
|
+
set_callback(:job, :before, *methods, &block)
|
23
|
+
end
|
24
|
+
|
25
|
+
def after_job(*methods, &block)
|
26
|
+
set_callback(:job, :after, *methods, &block)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -10,53 +10,9 @@ module Dronejob
|
|
10
10
|
def perform(params)
|
11
11
|
set_parameters(params)
|
12
12
|
validate_parameters!
|
13
|
-
|
14
|
-
|
15
|
-
if self.class.stateful?
|
16
|
-
load_variables
|
17
|
-
git_init(@working_dir.to_s)
|
18
|
-
git_collect_commits
|
19
|
-
git_commit("start")
|
20
|
-
if param(:from)
|
21
|
-
info("starting from phase #{param(:from)}")
|
22
|
-
phase = prev_phase(param(:from))
|
23
|
-
raise("phase '#{param(:from)}' not found!") if phase.nil? or @commits[phase.to_s].nil?
|
24
|
-
git_reset(phase.to_s)
|
25
|
-
else
|
26
|
-
git_reset
|
27
|
-
end
|
28
|
-
git_collect_commits
|
29
|
-
git_clean
|
13
|
+
run_callbacks :job do
|
14
|
+
run_phases
|
30
15
|
end
|
31
|
-
|
32
|
-
# Run through phases
|
33
|
-
each_phase do |phase, phase_config|
|
34
|
-
begin
|
35
|
-
phase_result = public_send(phase)
|
36
|
-
rescue Exception => e
|
37
|
-
error(e.message)
|
38
|
-
error(e.backtrace.join("\n"))
|
39
|
-
delete_working_dir if self.class.cleanup_on_error?
|
40
|
-
publish_status({title: self.title, description: e.message, phase: phase, backtrace: e.backtrace}, "failed") if param(:notify) and !param(:run)
|
41
|
-
return false
|
42
|
-
end
|
43
|
-
|
44
|
-
publish_status({title: self.title, description: phase_config[:title], phase: phase}, "working") if phase_config[:notify] and param(:notify) and !param(:run)
|
45
|
-
git_commit(phase) if self.class.stateful?
|
46
|
-
end
|
47
|
-
@phase = "complete"
|
48
|
-
|
49
|
-
publish_status({title: self.title, description: "Job Completed!", phase: @phase}, "complete") if param(:notify) and !param(:run)
|
50
|
-
|
51
|
-
delete_working_dir if self.class.cleanup_on_complete?
|
52
|
-
end
|
53
|
-
|
54
|
-
def uuid
|
55
|
-
@uuid ||= "#{self.class.name.split('::').last.underscore}_#{SecureRandom.uuid}"
|
56
|
-
end
|
57
|
-
|
58
|
-
def title
|
59
|
-
self.class.name
|
60
16
|
end
|
61
17
|
|
62
18
|
def shell
|
data/lib/dronejob/modules/git.rb
CHANGED
@@ -7,6 +7,22 @@ module Dronejob
|
|
7
7
|
|
8
8
|
included do
|
9
9
|
attr_reader :git, :commits
|
10
|
+
set_callback :job, :before, :git_init_job, if: :stateful?
|
11
|
+
set_callback(:phase, :after, if: :stateful?){git_commit(@phase)}
|
12
|
+
end
|
13
|
+
|
14
|
+
class_methods do
|
15
|
+
def stateful(value=true)
|
16
|
+
@stateful = value
|
17
|
+
end
|
18
|
+
|
19
|
+
def stateful?
|
20
|
+
!!@stateful
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def stateful?
|
25
|
+
self.class.stateful?
|
10
26
|
end
|
11
27
|
|
12
28
|
def git_init(path)
|
@@ -46,6 +62,28 @@ module Dronejob
|
|
46
62
|
end
|
47
63
|
end
|
48
64
|
|
65
|
+
def git_init_job
|
66
|
+
if self.class.stateful?
|
67
|
+
load_variables
|
68
|
+
git_init(@working_dir.to_s)
|
69
|
+
git_collect_commits
|
70
|
+
git_commit("start")
|
71
|
+
if param(:from) == "start"
|
72
|
+
info("starting from scratch")
|
73
|
+
git_reset("start")
|
74
|
+
elsif param(:from)
|
75
|
+
info("starting from phase #{param(:from)}")
|
76
|
+
phase = prev_phase(param(:from))
|
77
|
+
raise("phase '#{param(:from)}' not found!") if phase.nil? or @commits[phase.to_s].nil?
|
78
|
+
git_reset(phase.to_s)
|
79
|
+
else
|
80
|
+
git_reset
|
81
|
+
end
|
82
|
+
git_collect_commits
|
83
|
+
git_clean
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
49
87
|
end
|
50
88
|
end
|
51
89
|
end
|
data/lib/dronejob/modules/log.rb
CHANGED
@@ -9,8 +9,7 @@ module Dronejob
|
|
9
9
|
cattr_accessor(:logger) { ActiveSupport::TaggedLogging.new(ActiveSupport::Logger.new(STDOUT)) }
|
10
10
|
end
|
11
11
|
|
12
|
-
|
13
|
-
|
12
|
+
class_methods do
|
14
13
|
def log(level, message, phase=:global)
|
15
14
|
if !logger.nil?
|
16
15
|
logger.send(level, message)
|
@@ -41,7 +40,26 @@ module Dronejob
|
|
41
40
|
end
|
42
41
|
|
43
42
|
def error(message)
|
44
|
-
|
43
|
+
if Exception === message
|
44
|
+
say(" ERROR ", ["\e[38;5;15m", Thor::Shell::Color::BOLD, Thor::Shell::Color::ON_RED], false)
|
45
|
+
say(" #{message.class}: ", [Thor::Shell::Color::BOLD], false)
|
46
|
+
say("#{message.message}", [Thor::Shell::Color::BOLD, Thor::Shell::Color::RED])
|
47
|
+
backtrace(message.backtrace)
|
48
|
+
else
|
49
|
+
log(:error, message)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def backtrace(lines)
|
54
|
+
lines.each do |line|
|
55
|
+
line.gsub!("#{Dir.pwd}/", '')
|
56
|
+
(file, lineno, info) = line.split(":")
|
57
|
+
if /ruby\/?gems/.match(line).nil?
|
58
|
+
say(" #{lineno.rjust(5, ' ')} ", ["\e[48;5;255m", "\e[38;5;245m"], false)
|
59
|
+
say(" #{file} ", [Thor::Shell::Color::RED], false)
|
60
|
+
say(info, ["\e[38;5;245m"], true)
|
61
|
+
end
|
62
|
+
end
|
45
63
|
end
|
46
64
|
|
47
65
|
def error!(message)
|
@@ -2,12 +2,14 @@ module Dronejob
|
|
2
2
|
module Modules
|
3
3
|
module Phases
|
4
4
|
extend ActiveSupport::Concern
|
5
|
+
include ActiveSupport::Callbacks
|
5
6
|
|
6
7
|
included do
|
7
8
|
attr_accessor :phase
|
9
|
+
set_callback(:phase, :around){|r, block| logger.tagged(@phase, &block)}
|
8
10
|
end
|
9
11
|
|
10
|
-
|
12
|
+
class_methods do
|
11
13
|
def phase(key, options)
|
12
14
|
@phases ||= {}
|
13
15
|
@phases[key] = options
|
@@ -18,42 +20,46 @@ module Dronejob
|
|
18
20
|
end
|
19
21
|
end
|
20
22
|
|
21
|
-
def
|
22
|
-
|
23
|
-
|
23
|
+
def log_phase
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
def run_phases
|
28
|
+
self.class.phases.each do |phase, phase_config|
|
24
29
|
@phase = phase
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
30
|
+
@phase_config = phase_config
|
31
|
+
|
32
|
+
# initialize phase
|
33
|
+
fail "Phase not found: '#{phase}'" unless self.respond_to?(phase)
|
34
|
+
run_callbacks :phase do
|
35
|
+
if completed_phase?(phase) and !@phase_config[:always_run]
|
29
36
|
info("already completed")
|
30
37
|
elsif skip_phase?(phase)
|
31
38
|
info("skipping...")
|
32
39
|
else
|
33
|
-
info
|
40
|
+
info("running phase #{phase}")
|
34
41
|
# Require libraries
|
35
|
-
if
|
36
|
-
|
42
|
+
if !@phase_config[:require].nil?
|
43
|
+
@phase_config[:require].each do |library|
|
37
44
|
require library
|
38
45
|
end
|
39
46
|
end
|
40
47
|
|
41
48
|
# Include helpers
|
42
|
-
if
|
43
|
-
|
49
|
+
if !@phase_config[:helpers].nil?
|
50
|
+
@phase_config[:helpers].each do |helper|
|
44
51
|
helper_path = "helpers/#{helper}"
|
45
52
|
require "./app/#{helper_path}"
|
46
53
|
self.class.send(:include, helper_path.camelcase.constantize)
|
47
54
|
end
|
48
55
|
end
|
49
|
-
|
50
|
-
|
56
|
+
|
57
|
+
# OLD CODE FROM CORE
|
58
|
+
public_send(phase)
|
51
59
|
end
|
52
60
|
end
|
53
|
-
|
54
|
-
after_phase(phase, config) if self.respond_to?(:after_phase)
|
55
61
|
end
|
56
|
-
|
62
|
+
@phase = "complete"
|
57
63
|
@dronejob_completed = true
|
58
64
|
git_commit("dronejob_completed") if self.class.stateful?
|
59
65
|
end
|
@@ -2,12 +2,14 @@ module Dronejob
|
|
2
2
|
module Modules
|
3
3
|
module Queue
|
4
4
|
extend ActiveSupport::Concern
|
5
|
-
|
5
|
+
|
6
6
|
included do
|
7
7
|
attr_accessor :queue_adapter
|
8
|
+
set_callback :phase, :before, :notify_before_phase
|
9
|
+
set_callback :job, :after, :notify_after_job
|
8
10
|
end
|
9
11
|
|
10
|
-
|
12
|
+
class_methods do
|
11
13
|
def run_worker!
|
12
14
|
ActiveJob::Base.queue_adapter = self.queue_adapter
|
13
15
|
require 'sidekiq/cli'
|
@@ -28,6 +30,27 @@ module Dronejob
|
|
28
30
|
data[:secret_key] = option(:secret_key) if backend
|
29
31
|
Redis.new(url: option(:redis_url)).publish("processes_#{backend ? 'backend' : data[:user_id]}", data.to_json)
|
30
32
|
end
|
33
|
+
|
34
|
+
def publish_error(e)
|
35
|
+
publish_status({title: self.title, description: e.message, phase: @phase, backtrace: e.backtrace, progress: 100}, "failed") if should_notify?
|
36
|
+
end
|
37
|
+
|
38
|
+
def notify_before_phase
|
39
|
+
publish_status({title: self.title, description: @phase_config[:title], phase: @phase, progress: @phase_config[:progress]}, "working") if @phase_config[:notify] and should_notify?
|
40
|
+
end
|
41
|
+
|
42
|
+
def notify_after_job
|
43
|
+
publish_status({title: self.title, description: "Job Completed!", phase: @phase, progress: 100}, "complete") if should_notify?
|
44
|
+
end
|
45
|
+
|
46
|
+
def should_notify?
|
47
|
+
param(:notify) and !param(:run)
|
48
|
+
end
|
49
|
+
|
50
|
+
def publish_progress(progress, description=nil)
|
51
|
+
publish_status({title: self.title, description: description, phase: @phase, progress: progress}, "working") if should_notify?
|
52
|
+
end
|
53
|
+
|
31
54
|
end
|
32
55
|
end
|
33
56
|
end
|
@@ -5,7 +5,13 @@ module Dronejob
|
|
5
5
|
module Workspace
|
6
6
|
extend ActiveSupport::Concern
|
7
7
|
|
8
|
-
|
8
|
+
included do
|
9
|
+
cattr_accessor(:jobs_path) { "app/jobs" }
|
10
|
+
cattr_accessor(:output_path) { "tmp/jobs" }
|
11
|
+
set_callback :job, :after, :delete_working_dir
|
12
|
+
end
|
13
|
+
|
14
|
+
class_methods do
|
9
15
|
def cleanup_on_complete(value=true)
|
10
16
|
@cleanup_on_complete = value
|
11
17
|
end
|
@@ -22,12 +28,6 @@ module Dronejob
|
|
22
28
|
!!@cleanup_on_error
|
23
29
|
end
|
24
30
|
end
|
25
|
-
|
26
|
-
included do
|
27
|
-
attr_accessor :working_dir
|
28
|
-
cattr_accessor(:jobs_path) { "app/jobs" }
|
29
|
-
cattr_accessor(:output_path) { "tmp/jobs" }
|
30
|
-
end
|
31
31
|
|
32
32
|
def file(path, &block)
|
33
33
|
f = working_dir.file(path)
|
@@ -42,14 +42,16 @@ module Dronejob
|
|
42
42
|
working_dir.dir(path)
|
43
43
|
end
|
44
44
|
|
45
|
-
def
|
46
|
-
|
47
|
-
|
45
|
+
def working_dir
|
46
|
+
if !@working_dir
|
47
|
+
@working_dir = WorkspaceDir.new(File.join(self.class.output_path, uuid))
|
48
|
+
@working_dir.create
|
49
|
+
end
|
48
50
|
@working_dir
|
49
51
|
end
|
50
52
|
|
51
53
|
def delete_working_dir
|
52
|
-
working_dir.delete!
|
54
|
+
working_dir.delete! if self.class.cleanup_on_complete? && @working_dir
|
53
55
|
end
|
54
56
|
|
55
57
|
def asset_file(path)
|
data/lib/dronejob/version.rb
CHANGED
metadata
CHANGED
@@ -1,43 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dronejob
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Strebitzer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.11'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
17
|
+
- - ">="
|
25
18
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
27
|
-
-
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
19
|
+
version: 1.3.0
|
20
|
+
- - "<"
|
32
21
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
22
|
+
version: '2.0'
|
34
23
|
type: :runtime
|
35
24
|
prerelease: false
|
36
25
|
version_requirements: !ruby/object:Gem::Requirement
|
37
26
|
requirements:
|
38
|
-
- - "
|
27
|
+
- - ">="
|
39
28
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
29
|
+
version: 1.3.0
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '2.0'
|
41
33
|
- !ruby/object:Gem::Dependency
|
42
34
|
name: git
|
43
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,20 +58,6 @@ dependencies:
|
|
66
58
|
- - "~>"
|
67
59
|
- !ruby/object:Gem::Version
|
68
60
|
version: '0.19'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: sidekiq
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: 4.1.0
|
76
|
-
type: :runtime
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: 4.1.0
|
83
61
|
- !ruby/object:Gem::Dependency
|
84
62
|
name: haml
|
85
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -95,33 +73,33 @@ dependencies:
|
|
95
73
|
- !ruby/object:Gem::Version
|
96
74
|
version: '4.0'
|
97
75
|
- !ruby/object:Gem::Dependency
|
98
|
-
name: sidekiq
|
76
|
+
name: sidekiq
|
99
77
|
requirement: !ruby/object:Gem::Requirement
|
100
78
|
requirements:
|
101
79
|
- - "~>"
|
102
80
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
81
|
+
version: '4.1'
|
104
82
|
type: :runtime
|
105
83
|
prerelease: false
|
106
84
|
version_requirements: !ruby/object:Gem::Requirement
|
107
85
|
requirements:
|
108
86
|
- - "~>"
|
109
87
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
88
|
+
version: '4.1'
|
111
89
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
90
|
+
name: sidekiq-status
|
113
91
|
requirement: !ruby/object:Gem::Requirement
|
114
92
|
requirements:
|
115
93
|
- - "~>"
|
116
94
|
- !ruby/object:Gem::Version
|
117
|
-
version: '0.
|
95
|
+
version: '0.6'
|
118
96
|
type: :runtime
|
119
97
|
prerelease: false
|
120
98
|
version_requirements: !ruby/object:Gem::Requirement
|
121
99
|
requirements:
|
122
100
|
- - "~>"
|
123
101
|
- !ruby/object:Gem::Version
|
124
|
-
version: '0.
|
102
|
+
version: '0.6'
|
125
103
|
- !ruby/object:Gem::Dependency
|
126
104
|
name: rubyzip
|
127
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -164,6 +142,20 @@ dependencies:
|
|
164
142
|
- - "~>"
|
165
143
|
- !ruby/object:Gem::Version
|
166
144
|
version: '1.0'
|
145
|
+
- !ruby/object:Gem::Dependency
|
146
|
+
name: open_uri_redirections
|
147
|
+
requirement: !ruby/object:Gem::Requirement
|
148
|
+
requirements:
|
149
|
+
- - "~>"
|
150
|
+
- !ruby/object:Gem::Version
|
151
|
+
version: '0.2'
|
152
|
+
type: :runtime
|
153
|
+
prerelease: false
|
154
|
+
version_requirements: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - "~>"
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0.2'
|
167
159
|
- !ruby/object:Gem::Dependency
|
168
160
|
name: rspec
|
169
161
|
requirement: !ruby/object:Gem::Requirement
|
@@ -211,6 +203,7 @@ files:
|
|
211
203
|
- lib/dronejob/command.rb
|
212
204
|
- lib/dronejob/loader.rb
|
213
205
|
- lib/dronejob/modules/attr_store.rb
|
206
|
+
- lib/dronejob/modules/callbacks.rb
|
214
207
|
- lib/dronejob/modules/core.rb
|
215
208
|
- lib/dronejob/modules/git.rb
|
216
209
|
- lib/dronejob/modules/log.rb
|
@@ -218,7 +211,6 @@ files:
|
|
218
211
|
- lib/dronejob/modules/params.rb
|
219
212
|
- lib/dronejob/modules/phases.rb
|
220
213
|
- lib/dronejob/modules/queue.rb
|
221
|
-
- lib/dronejob/modules/stateful.rb
|
222
214
|
- lib/dronejob/modules/workspace.rb
|
223
215
|
- lib/dronejob/railtie.rb
|
224
216
|
- lib/dronejob/railties/dronejob.rake
|