Skip to content

Sync hooks #189

Description

@hasufell

S3 isn't the only way to backup your store. We can already write to a local directory, but what I envision are sync hooks.

For sync-to:

  1. cabal-cache writes the to be synced artifacts into a temp dir
  2. It CDs to that directory
  3. It invokes the sync hook
  4. It cleans up the directory

For sync-from:

  1. it writes a file that contains all the artifact names that should be pulled (one artifact per line) to a temporary location
  2. It creates another temporary directory and CDs into it
  3. it invokes the hook with the filename as the first argument and expects the hook to sync to the current directory
  4. it merges the files to the cabal store
  5. It cleans up all the dirs

Then we would have two scripts per hook. E.g. we would have for rsync:

  1. ~/.config/cabal/cache/hooks/rsync/from.sh
  2. ~/.config/cabal/cache/hooks/rsync/to.sh

And you would invoke cabal-cache like so: cabal-cache sync-to --method=rsync.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions