Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i136-create-s3-download-to-bulkrax-import-rake-task #915

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

aprilrieger
Copy link
Collaborator

@aprilrieger aprilrieger commented Sep 5, 2024

Ref Ticket #scientist-softserv#136

Adding a script to download obj from s3 bucket folder and create a bulkrax importer that was from when Rob migrated the objs previously but added in a reusable manner.

How to Test

Set these env vars in the .env locally (don't commit secrets)

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_S3_BUCKET="ams.americanarchive.org"
AWS_REGION=us-east-1
S3_FOLDER="april-test-script"

In the docker container docker compose exec web bash run rake ams:copy_files_from_s3

Once the script completes you will be able to navigate to the Bulkrax importers page and see some new importers that are in status Pending with titles like AMS1Importer_#{start_at}-#{end_at}"

They will only be run when you manually run them. You will need to go to the importer's page and select Edit at bottom of page and click the Update and Import button to run the importer.

@aprilrieger aprilrieger changed the title DRAFT: i136-create-s3-download-to-bulkrax-import-rake-task i136-create-s3-download-to-bulkrax-import-rake-task Sep 6, 2024

# Optionally move or rename files if necessary (file cleanup)
Dir.glob("#{file_path}/*xml").each do |file|
new_name = file.strip
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The glob #{filepath/*xml} is the same as "tmp/imports/#{batch_name}/*xml", and I don't think anything in that glob is going to have leading or trailing white space that would result in landing in the condition file != file.strip.... iow, i don't think this will ever actually move anything. What are the conditions for which files were needing to be moved?

Also, the output "File renamed..." should probably be inside the conditional that does the renaming, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants