scout-camp 0.2.0 → 0.2.1

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: bbf3734e6eac7bcc3df575024caee67996cf792548a667f8b086aba62f5af591
4
- data.tar.gz: c0564fda160712dd5846a91ae6af52a03656efe2cdfb8a930f843f7d34f22b9d
3
+ metadata.gz: 95942fcee4143e58526623713e4d977d77903f49e179dd0f4171bf72e2bde29d
4
+ data.tar.gz: 263d45c4b8cf6bc08688dccb7db0b302b89ee3bf81bedfed5fc3fe609191e3ba
5
5
  SHA512:
6
- metadata.gz: 00cf8db6a044aea2ef27dc15ea65cd394d2f92a6e40f2d56d924d82a59d27052202334f0cf7472f8adb7739b52e0fd005c848ce45c1240219292e9ba1b15b440
7
- data.tar.gz: bca7c05eed1801cb873676cf1f640e1ec543c500bcd6990093640a5be5191075c2c788820cddb4432e92c3f4929ac5a36a98c10f09eefb7afcf4de88f1eb8cd0
6
+ metadata.gz: 4d784bac738560c14febe73a1a0d983c885d675e20a547ad4698002840a0c51aa39a93c9512ffee1298a3e50aeda6cbacc7c55fd6f436b4e7ed5fa7279002cf4
7
+ data.tar.gz: 1744d6a3054fa7f7c7647a766ac1858e6cd68d73051e6d38b96bb0b7d48e9613738ebd4d631b5a8fb108288ea20d0b1ceb798bd0fcd86a2da86c844a56bd4d56
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -13,6 +13,7 @@ module OffsiteStep
13
13
  file = ".scout/tmp/step_inputs/#{workflow}/#{task_name}/#{name}"
14
14
  TmpFile.with_path do |inputs_dir|
15
15
  save_inputs(inputs_dir)
16
+ inputs_dir = inputs_dir + '/' unless inputs_dir.ends_with? '/'
16
17
  SSHLine.rsync(inputs_dir, file, target: server, directory: inputs_dir.directory?)
17
18
  end
18
19
  file
@@ -72,7 +73,7 @@ job = wf.job(:#{task_name}, "#{clean_name}");
72
73
  end
73
74
 
74
75
  def done?
75
- status == :done
76
+ status == :done || Open.exists?(path)
76
77
  end
77
78
 
78
79
  def orchestrate_batch
@@ -86,22 +87,26 @@ job = wf.job(:#{task_name}, "#{clean_name}");
86
87
  SSHLine.sync(bundle_files, source: server)
87
88
  end
88
89
 
89
- def exec(noload)
90
+ def exec(noload = false)
90
91
  bundle_files = offsite_job_ssh <<~EOF
91
92
  Workflow.produce(job)
92
93
  job.join
93
94
  job.bundle_files
94
95
  EOF
95
- SSHLine.sync(bundle_files, source: server)
96
+ SSHLine.sync(bundle_files, source: server, rsync_args: '-vztHP --copy-unsafe-links --omit-dir-times ')
96
97
  noload ? self.path : self.load
97
98
  end
98
99
 
99
100
  def run(noload=false)
100
- if batch
101
- orchestrate_batch
102
- noload ? self.path : self.load
103
- else
104
- exec(noload)
101
+ begin
102
+ if batch
103
+ orchestrate_batch
104
+ noload ? self.path : self.load
105
+ else
106
+ exec(noload)
107
+ end
108
+ ensure
109
+ @info = nil
105
110
  end
106
111
  end
107
112
  end
@@ -36,13 +36,14 @@ located = located.each{|path| path << "/" if path && path.directory? && ! path.e
36
36
  [located, identified]
37
37
  end
38
38
 
39
- def self.rsync(source_path, target_path, directory: false, source: nil, target: nil, dry_run: false, hard_link: false)
40
- rsync_args = "-avztHP --copy-unsafe-links --omit-dir-times "
39
+ def self.rsync(source_path, target_path, directory: false, source: nil, target: nil, dry_run: false, hard_link: false, rsync_args: nil)
40
+ rsync_args = "-avztHP --copy-unsafe-links --omit-dir-times " if rsync_args.nil?
41
41
 
42
42
  rsync_args << "--link-dest '#{source_path}' " if hard_link && ! source
43
43
 
44
44
  source_path = source_path + "/" if directory && ! source_path.end_with?("/")
45
45
  target_path = target_path + "/" if directory && ! target_path.end_with?("/")
46
+
46
47
  if target
47
48
  SSHLine.mkdir target, File.dirname(target_path)
48
49
  else
@@ -52,6 +53,9 @@ located = located.each{|path| path << "/" if path && path.directory? && ! path.e
52
53
  source_path = File.expand_path(source_path) unless source
53
54
  target_path = File.expand_path(target_path) unless target
54
55
 
56
+ source_path = source_path + "/" if directory && ! source_path.end_with?("/")
57
+ target_path = target_path + "/" if directory && ! target_path.end_with?("/")
58
+
55
59
  cmd = 'rsync '
56
60
  cmd << rsync_args
57
61
  cmd << '-nv ' if dry_run
data/scout-camp.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: scout-camp 0.2.0 ruby lib
5
+ # stub: scout-camp 0.2.1 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "scout-camp".freeze
9
- s.version = "0.2.0".freeze
9
+ s.version = "0.2.1".freeze
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scout-camp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez