Description¶
Downloads all artifacts associated with a SIVACOR submission ID, handles ZIP file extraction, and commits the results to a git branch. Automates the workflow of fetching SIVACOR submissions and integrating them into the repository.
Usage¶
python3 tools/download_sivacor.py [JIRA_CASE]Arguments¶
JIRA_CASE (optional) - Jira case number (e.g., aearep-8885)
The script determines the Jira case in this order of precedence:
Command line argument
Current directory name (if starts with
aearep-)jiraticketfield in config.yml
Examples¶
# Using current directory name as Jira case
cd aearep-8885
python3 tools/download_sivacor.py
# Specifying Jira case explicitly
python3 tools/download_sivacor.py aearep-8885
# Using config.yml (jiraticket field)
python3 tools/download_sivacor.pyRequirements¶
Python >= 3.6
jira: Python Jira libraryyaml: YAML configuration file supportsivacor: SIVACOR CLI tool (installed via pip)
Environment Variables Required¶
JIRA_USERNAME- Your Jira email addressJIRA_API_KEY- API token from https://id .atlassian .com /manage -profile /security /api -tokens SIVACOR environment variables as required by sivacor CLI
Workflow¶
Determines Jira case from argument, directory name, or config.yml
Looks up SIVACOR ID from Jira ticket
Determines target folder from config.yml (precedence: openicpsr > zenodo > dataverse > osf)
Downloads all artifacts using sivacor CLI
If ZIP file exists:
Clears folder contents (keeping folder)
Unpacks ZIP
Downloads other artifacts
Creates branch
sivacor-{sivacor_id}(lowercase)Git adds and commits the folder
Error Handling¶
Exits with error if SIVACOR ID field is not populated in Jira
Validates target folder existence
Handles missing config.yml gracefully
See Also¶
Pipeline
8-download-sivacorin bitbucket-pipelines .yml