Skip to content

Commit

Permalink
add usage comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Luis Ramirez committed Jan 28, 2020
1 parent 5b9f4a6 commit 2f7f142
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions lib/tasks/export_bags.rake
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
# frozen_string_literal: true

require 'bagit'

# Usage:
#
# task export_datastreams
# args
# input_tsv: full path to the tsv file
# batch: name of a batch or group of assets (or collections)
#
# example:
#
# RAILS_ENV=production bundle exec rake export_datastreams input_tsv="/data1/batch/exports/od2_seed_data_pids_Baseball_jpegs.tsv"
#
desc 'Export datastreams given a vts file'
task :export_datastreams => :environment do |t, args|
batch = ENV['batch']
path_to_tsv_file = ENV['input_tsv']
path_to_export_dir = "/data1/batch/exports/"
path_to_tsv_file = "/data1/batch/exports/od2_seed_data_pids_#{batch}.tsv"
keylist = { "DC" => "xml", "RELS-EXT" => "xml", "rightsMetadata" => "xml", "workflowMetadata" => "yml", "descMetadata" => "nt", "leafMetadata" => "yml"}
File.readlines(path_to_tsv_file).each do |line|
line_cols = line.split("\t")
Expand All @@ -27,6 +39,16 @@ task :export_datastreams => :environment do |t, args|
puts "export_datastreams done"
end

# Usage:
#
# task make_bags
# args
# batch: name of a batch or group of assets (or collections)
#
# example:
#
# RAILS_ENV=production bundle exec rake make_bags batch="Baseball_jpegs"
#
desc 'Make bags given re-exported datastreams'
task :make_bags => :environment do |t, args|
batch = ENV['batch']
Expand Down

0 comments on commit 2f7f142

Please sign in to comment.