From d77291ce7ef227b28d3e8f68ebc9be72c22a314d Mon Sep 17 00:00:00 2001 From: gebele Date: Thu, 23 Nov 2017 15:00:36 +0000 Subject: string fixes;set rule and todo for dump with linked container --- lazar_validation_reports.rb | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lazar_validation_reports.rb b/lazar_validation_reports.rb index 85e9888..2047f0e 100644 --- a/lazar_validation_reports.rb +++ b/lazar_validation_reports.rb @@ -18,11 +18,10 @@ models.each_with_index do |model, idx| # define file name type = model.regression? ? "regression" : "classification" - #name = model.model.name.gsub!(/[^0-9A-Za-z.\-]/, '_') date = model.created_at.to_s.split.first dataset_name = model.training_dataset.source.split("/").last - name = (model.endpoint + "_" + model.species + "_" + dataset_name).gsub!(/[^0-9A-Za-z.\-]/, '_') - branch = model.model.version["branch"] + name = (model.endpoint + "_" + model.species + "_" + dataset_name).gsub!(/[^0-9A-Za-z.\-]/, '_').gsub!(/\.csv$/,"") + branch = model.model.version["branch"].gsub(/\//,"-") commit = model.model.version["commit"] filename = [date,type,branch,commit,name].join("_") @@ -52,5 +51,10 @@ models.each_with_index do |model, idx| end # store database dump in users home dir subfolder -puts "Storing database dump." -`mongodump -h #{ CENTRAL_MONGO_IP.blank? ? "127.0.0.1" : CENTRAL_MONGO_IP} -o #{path}/#{Time.now.to_s.split.first}-dump-#{ENV["LAZAR_ENV"]} -d #{ENV["LAZAR_ENV"]}` +if !CENTRAL_MONGO_IP.blank? + #TODO Can not dump because mongo commands missing in linked container ! + #`mongodump -h #{CENTRAL_MONGO_IP} -o #{path}/#{Time.now.to_s.split.first}-dump-#{ENV["LAZAR_ENV"]} -d #{ENV["LAZAR_ENV"]}` +else + puts "Storing database dump." + `mongodump -h 127.0.0.1 -o #{path}/#{Time.now.to_s.split.first}-dump-#{ENV["LAZAR_ENV"]} -d #{ENV["LAZAR_ENV"]}` +end -- cgit v1.2.3