grid icon indicating copy to clipboard operation
grid copied to clipboard

Make XSD download tool for CLI

Open shannynalayna opened this issue 4 years ago • 1 comments

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.

shannynalayna avatar Jan 13 '22 17:01 shannynalayna

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/artifact with a -temp to denote that it's a download in progress (don't use a tempdir)
    • There should be an option --no-download to disable downloading the zip (but still extract)
    • If it exists in the cache, skip download
  • Do a checksum and make sure the checksum is what we expect (again, hardcoded into the command)
    • There should be a command line option --force to disable validation
    • Error should include the path of the file
  • Rename the file as an atomic step to remove -temp from 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

ameliabradley avatar Jan 14 '22 18:01 ameliabradley