(->op diff s3-key)
Given a diff and a key return the required operation to sync
Given a diff and a key return the required operation to sync
(calculate-ops bucket-objects file-maps)
Generate set of operations to get in sync from a given diff
Generate set of operations to get in sync from a given diff
(cloudfront-invalidate! cred distribution-id paths)
Create an invalidation for paths
in dist
.
Create an invalidation for `paths` in `dist`.
(dedupe-diff {:keys [changed removed] :as diff})
Remove all keys that are in the changed map from the removed map.
Remove all keys that are in the changed map from the removed map.
(diff* bucket-objects file-maps)
Get the difference between objects in a S3 bucket and files on disk.
If a file is changed the old version {key,md5} will be part of the
removed
key.
bucket-objects
is expected to be a list bucket object
summaries as they are returned by amazonica.aws.s3/list-objects
.
file-maps
is a seq of maps containing the following keys: s3-key, file.
Get the difference between objects in a S3 bucket and files on disk. If a file is changed the old version {key,md5} will be part of the `removed` key. - `bucket-objects` is expected to be a list bucket object summaries as they are returned by `amazonica.aws.s3/list-objects`. - `file-maps` is a seq of maps containing the following keys: s3-key, file.
(dir->file-maps dir)
Create a file-map as it's expected by diff*
from a local directory.
Create a file-map as it's expected by `diff*` from a local directory.
(sync! cred bucket-name file-maps)
(sync! cred bucket-name file-maps {:keys [report-fn prune? dry-run?]})
Sync files described by file-maps
to S3 bucket-name
.
The file-maps collection may be ordered in which case S3
operations will be executed in the same order.
file-maps
need to have the following keys :s3-key
& :file
.
Optionally a :metadata
key can be supplied to add custom
metadata to the uploaded S3 object.
Changes to an objects metadata will only get updated if also the object itself changed, i.e. changes only to an objects metadata will not cause the remote object to get updated.
Recognized options:
report-fn
takes 2 arguments (type, data) will be called
for each added and changed file being uploaded to S3.dry-run?
if truthy no side effects will be executed.prune?
is a truthy value sync!
will delete files
from the S3 bucket that are not in file-map
.Sync files described by `file-maps` to S3 `bucket-name`. The file-maps collection may be ordered in which case S3 operations will be executed in the same order. `file-maps`need to have the following keys `:s3-key` & `:file`. Optionally a `:metadata` key can be supplied to add custom metadata to the uploaded S3 object. Changes to an objects metadata will only get updated if also the object itself changed, i.e. changes only to an objects metadata will not cause the remote object to get updated. Recognized options: - `report-fn` takes 2 arguments (type, data) will be called for each added and changed file being uploaded to S3. - `dry-run?` if truthy no side effects will be executed. - if `prune?` is a truthy value `sync!` will delete files from the S3 bucket that are not in `file-map`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close