grid
grid copied to clipboard
Make XSD download tool for CLI
Enable users to use a command via the CLI to download XSD files. This should be something similar to grid po xsd-download and grid product xsd-download. Users should be able to configure where these files are stored, the default storage place may stay the same.
Extra reqs after speaking with @vaporos:
- URL is hardcoded as a const array of URL / checksum pairs (one per version)
- Download the zip to a static dir like
/var/lib/grid/xsds/artifactwith a-tempto denote that it's a download in progress (don't use a tempdir)- There should be an option
--no-downloadto disable downloading the zip (but still extract) - If it exists in the cache, skip download
- There should be an option
- Do a checksum and make sure the checksum is what we expect (again, hardcoded into the command)
- There should be a command line option
--forceto disable validation - Error should include the path of the file
- There should be a command line option
- Rename the file as an atomic step to remove
-tempfrom the file name - Do a checksum (again) to make sure the file is valid (this will be important if the file was cached)
- Extract and move XSD contents to expected locations