Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
RDMS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
researchdata
RDMS
Commits
57919b24
Commit
57919b24
authored
1 year ago
by
Anusha Ranganathan
Browse files
Options
Downloads
Patches
Plain Diff
Modified rake task to save metadata in S3
parent
c3e6182e
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!284
Modified rake task to save metadata in S3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hyrax/lib/tasks/fix_metadata_in_s3.rake
+26
-7
26 additions, 7 deletions
hyrax/lib/tasks/fix_metadata_in_s3.rake
with
26 additions
and
7 deletions
hyrax/lib/tasks/fix_metadata_in_s3.rake
+
26
−
7
View file @
57919b24
...
...
@@ -2,16 +2,35 @@
namespace
:rdms
do
desc
"Fix metadata in S3 for all works. usage: rdms:fix_metadata_in_s3"
task
fix_metadata_in_s3: :environment
do
puts
"Fixing Dataset"
all_works
=
%w(Dataset CrcDataset ComplexSubjecr ComplexSession ComplexModality)
all_works
=
%w(Dataset CrcDataset ComplexSubject ComplexSession ComplexModality)
all_works
.
each
do
|
work_type
|
work_type
.
constantize
.
all
.
each
do
|
w
|
begin
w
.
save
rescue
puts
"Error saving
#{
w
.
id
}
"
# Save the metadata.json file along with system_metadata.json
puts
"Saving metadata for
#{
work_type
}
#{
w
.
id
}
"
case
work_type
when
'Dataset'
,
'CrcDataset'
begin
w
.
save_work_meta_json_file_to_s3
rescue
puts
"error saving metadata for
#{
work_type
}
#{
w
.
id
}
"
end
else
begin
w
.
send
(
:save_work_meta_json_file_to_s3
)
rescue
puts
"error saving metadata for
#{
work_type
}
#{
w
.
id
}
"
end
end
if
work_type
==
"CrcDataset"
# save meta.json for modalities
puts
"Saving meta.json for
#{
work_type
}
#{
w
.
id
}
"
begin
w
.
handle_meta_file_on_s3
rescue
puts
"error saving metadata for
#{
work_type
}
#{
w
.
id
}
"
end
end
end
end
end
end
\ No newline at end of file
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment