| Add a (for now) dev-only lein alias to timeshift wire format exports (produced by the pdb archive endpoint). Perhaps something like this:
lein timeshift-export --timeshift-to now -o timeshifted.tgz original.tgz
|
See the :install-gems alias in project.clj for an example:
:install-gems {:source-paths ^:replace ["src-gems"] |
:target-path "target-gems" |
:dependencies ~puppetserver-test-deps}
|
We might be fine with the normal (non-test) deps (not sure), and might want to include the main tree in the source paths, i.e. maybe :source-paths ^:replace ["src-shift-export" "src"] or something. Could also use https://github.com/clojure/tools.cli for the argument processing. Alhough if the above options are all we need for now, then handling the arguments manually may be sufficient. In terms of the processing, we'll presumably open the archive, traverse it once, parsing the commands to collect the min and max timestamps (just like the SQL shifting code we're adding in PDB-4771 does). Then we'll open the output file and traverse input archive again to read, timeshift and write the commands to the output archive. See the code related to the archive endpoint for examples of opening, reading, and writing the archive files. |