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

Create bash script to automate retrieval & update of PDG portal #4

Open
robyngit opened this issue Feb 21, 2024 · 1 comment
Open
Assignees
Labels
enhancement New feature or request

Comments

@robyngit
Copy link
Member

robyngit commented Feb 21, 2024

To speed up the process of managing the PDG portal's content, it would be helpful to develop a Bash script that automates the process of retrieving and updating the portal XML doc in both production and test environments using the DataONE API. The current update-PDG-portal.Rmd file is helpful in this task, but a bash script will be quicker to run and will require less setup for new users (especially those not familiar with R).

The script will:

  • Retrieve the Latest Portal Version: The script should be able to query the DataONE API to find the latest version of the permafrost portal. It should handle both production (PROD) and test (STAGING) environments.

  • Download Portal XML: After identifying the latest version, the script should download the corresponding XML document, allowing for local editing.

  • Update Portal XML: The script should be capable of uploading a modified XML document back to the ADC, thus updating the portal.

  • Command Line Flexibility: The script should accept command line arguments for different actions (download or update), environments (production or test), and the user's authentication token.

@robyngit robyngit self-assigned this Feb 21, 2024
@robyngit robyngit added the enhancement New feature or request label Feb 21, 2024
@mbjones
Copy link
Member

mbjones commented Feb 21, 2024

This sounds great. Most of that functionality is already present in the dataone R package. All you'd need to do is customize the query function to find the portal of interest. the token, download, and upload code is already there. So a lightweight wrapper around the R client would be straightforward. Also true for the python client I think. Of course, you could do it in curl/bash as well, but there's a fair amount you'd need to do in shell on the upload side to get it to work (like creating/updating a valid sysmeta document).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Development

No branches or pull requests

2 participants