Skip to content

Instantly share code, notes, and snippets.

@micha
Created June 25, 2015 14:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micha/3fff1e472f730ea8b22f to your computer and use it in GitHub Desktop.
Save micha/3fff1e472f730ea8b22f to your computer and use it in GitHub Desktop.
(deftask s3cmd
"Sync frontend with S3 bucket."
[b bucket-name NAME str "Name of the bucket to sync to."]
(assert bucket-name "bucket-name is a required argument.")
(let [tmp (temp-dir!)
path (str (.getPath tmp) "/")
ACCESS (System/getenv "ADZERK_AWS_ACCESS_KEY")
SECRET (System/getenv "ADZERK_AWS_SECRET_KEY")]
(with-pre-wrap fs
(with-let [fs fs]
(apply sync! tmp (->> fs output-dirs))
(dosh "s3cmd"
"--access_key" ACCESS
"--secret_key" SECRET
"-P"
"-M"
"--no-mime-magic"
"sync" path (format "s3://%s" bucket-name))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment