cnvrg 0.2.2 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cnvrg/cli.rb +12 -5
- data/lib/cnvrg/project.rb +11 -6
- data/lib/cnvrg/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 243d59aeb144ce81e378b909f57d72ff2d95b2b6
|
4
|
+
data.tar.gz: af1c7b5e0b44738cc4de38893db71599b6303c9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b75af796386c9b18d11e013f698eca78167d5c0e911c81156f4680dfb53809a14b45534bc272fe593fb205ba8c07415f60aa3adaec8e892bd608bc4fe95bbf95
|
7
|
+
data.tar.gz: 4685770d2b7bd298a454b6c8936ee40d67e8d8ebeb820d9fcbf455836d26547519d592cefafa777d8c92c01e1f63ec17833b1d7e8bd00518f77ec02e2bc2fcf4
|
data/lib/cnvrg/cli.rb
CHANGED
@@ -1584,7 +1584,7 @@ module Cnvrg
|
|
1584
1584
|
end
|
1585
1585
|
successful_changes = response["result"]["tree"]
|
1586
1586
|
if !successful_changes.nil? and is_success
|
1587
|
-
Project.verify_cnvrgignore_exist(project_name)
|
1587
|
+
Project.verify_cnvrgignore_exist(project_name,remote)
|
1588
1588
|
log_message("Done.\nDownloaded #{successful_changes.size}/#{response["result"]["tree"].size} files", Thor::Shell::Color::GREEN)
|
1589
1589
|
else
|
1590
1590
|
log_message("Couldn't download some files", Thor::Shell::Color::RED)
|
@@ -2355,6 +2355,7 @@ module Cnvrg
|
|
2355
2355
|
method_option :data, :type => :string, :aliases => ["-d", "--data"], :default => ""
|
2356
2356
|
method_option :data_commit, :type => :string, :aliases => ["--data_commit"], :default => ""
|
2357
2357
|
method_option :ignore, :type => :string, :aliases => ["-i", "--ignore"], :desc => "ignore following files", :default => ""
|
2358
|
+
method_option :force, :type => :boolean, :aliases => ["-f","--force"], :default => false
|
2358
2359
|
|
2359
2360
|
def run(*cmd)
|
2360
2361
|
sync_before = options["sync_before"]
|
@@ -2371,6 +2372,8 @@ module Cnvrg
|
|
2371
2372
|
data = options["data"]
|
2372
2373
|
data_commit = options["data_commit"]
|
2373
2374
|
ignore = options["ignore"]
|
2375
|
+
force = options["force"]
|
2376
|
+
|
2374
2377
|
options_hash = Hash[options]
|
2375
2378
|
real_options = []
|
2376
2379
|
options_hash.each do |o|
|
@@ -2379,7 +2382,7 @@ module Cnvrg
|
|
2379
2382
|
if local
|
2380
2383
|
invoke :exec, [cmd], :sync_before => sync_before, :sync_after => sync_after, :title => title,
|
2381
2384
|
:log => log, :email_notification => email_notification, :upload_output => upload_output,
|
2382
|
-
:commit => commit, :image => image, :data => data, :data_commit => data_commit, :ignore => ignore
|
2385
|
+
:commit => commit, :image => image, :data => data, :data_commit => data_commit, :ignore => ignore, :force=>force
|
2383
2386
|
return
|
2384
2387
|
else
|
2385
2388
|
real_options.delete(["local", false])
|
@@ -2393,7 +2396,7 @@ module Cnvrg
|
|
2393
2396
|
cmd_to_exec = "#{exec_options} #{cmd.join(" ")}"
|
2394
2397
|
invoke :exec_remote, [cmd], :sync_before => sync_before, :sync_after => sync_after, :title => title, :machine_type => instance_type,
|
2395
2398
|
:schedule => schedule, :log => log, :email_notification => email_notification, :upload_output => upload_output, :commit => commit,
|
2396
|
-
:image => image, :grid => grid, :data => data, :data_commit => data_commit, :ignore => ignore
|
2399
|
+
:image => image, :grid => grid, :data => data, :data_commit => data_commit, :ignore => ignore, :force=>force
|
2397
2400
|
return
|
2398
2401
|
end
|
2399
2402
|
|
@@ -2424,6 +2427,7 @@ module Cnvrg
|
|
2424
2427
|
method_option :ignore, :type => :string, :aliases => ["-i", "--ignore"], :desc => "ignore following files", :default => ""
|
2425
2428
|
method_option :remote, :type => :boolean, :aliases => ["--remote"], :default => false
|
2426
2429
|
method_option :gpu, :type => :boolean, :aliases => ["--gpu"], :default => false
|
2430
|
+
method_option :force, :type => :boolean, :aliases => ["-f","--force"], :default => false
|
2427
2431
|
|
2428
2432
|
def exec(*cmd)
|
2429
2433
|
|
@@ -2444,6 +2448,7 @@ module Cnvrg
|
|
2444
2448
|
image = options["image"] || nil
|
2445
2449
|
indocker = options["indocker"] || false
|
2446
2450
|
ignore = options[:ignore] || ""
|
2451
|
+
force = options[:force]
|
2447
2452
|
|
2448
2453
|
|
2449
2454
|
email_notification = options["email_notification"]
|
@@ -2461,7 +2466,7 @@ module Cnvrg
|
|
2461
2466
|
if sync_before
|
2462
2467
|
# Sync before run
|
2463
2468
|
|
2464
|
-
invoke :sync, [false], :new_branch => is_new_branch, :ignore => ignore
|
2469
|
+
invoke :sync, [false], :new_branch => is_new_branch, :ignore => ignore, :force => force
|
2465
2470
|
end
|
2466
2471
|
end
|
2467
2472
|
#set image for the project
|
@@ -2890,6 +2895,7 @@ module Cnvrg
|
|
2890
2895
|
method_option :data, :type => :string, :aliases => ["-d", "--data"], :default => ""
|
2891
2896
|
method_option :data_commit, :type => :string, :aliases => ["--data_commit"], :default => ""
|
2892
2897
|
method_option :ignore, :type => :string, :aliases => ["-i", "--ignore"], :desc => "ignore following files", :default => ""
|
2898
|
+
method_option :force, :type => :boolean, :aliases => ["-f","--force"], :default => false
|
2893
2899
|
|
2894
2900
|
def exec_remote(*cmd)
|
2895
2901
|
verify_logged_in(true)
|
@@ -2902,6 +2908,7 @@ module Cnvrg
|
|
2902
2908
|
data = options["data"] || nil
|
2903
2909
|
data_commit = options["data_commit"] || nil
|
2904
2910
|
sync_before = options["sync_before"]
|
2911
|
+
force = options["force"]
|
2905
2912
|
|
2906
2913
|
instance_type = options["machine_type"] || nil
|
2907
2914
|
schedule = options["schedule"] || ""
|
@@ -2971,7 +2978,7 @@ module Cnvrg
|
|
2971
2978
|
image_slug = image.image_slug
|
2972
2979
|
end
|
2973
2980
|
|
2974
|
-
invoke :sync, [false],
|
2981
|
+
invoke :sync, [false], :force=>force if sync_before
|
2975
2982
|
|
2976
2983
|
|
2977
2984
|
if command.include? "'"
|
data/lib/cnvrg/project.rb
CHANGED
@@ -234,18 +234,23 @@ module Cnvrg
|
|
234
234
|
end
|
235
235
|
return true
|
236
236
|
end
|
237
|
-
def self.verify_cnvrgignore_exist(project_name)
|
238
|
-
|
237
|
+
def self.verify_cnvrgignore_exist(project_name,remote)
|
238
|
+
if remote
|
239
|
+
path = ".cnvrgignore"
|
240
|
+
else
|
241
|
+
path = "#{project_name}/.cnvrgignore"
|
242
|
+
end
|
243
|
+
ignore_exits = File.exist? path
|
239
244
|
if !ignore_exits
|
240
245
|
begin
|
241
|
-
|
242
|
-
|
246
|
+
list_files = [
|
247
|
+
path
|
243
248
|
]
|
244
249
|
FileUtils.touch list_files
|
245
250
|
cnvrgignore = Helpers.cnvrgignore_content
|
246
|
-
File.open(
|
251
|
+
File.open(path, "w+") { |f| f.write cnvrgignore }
|
247
252
|
rescue => e
|
248
|
-
|
253
|
+
return false
|
249
254
|
end
|
250
255
|
|
251
256
|
|
data/lib/cnvrg/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cnvrg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yochay Ettun
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-11-
|
12
|
+
date: 2017-11-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|