Skip to content

Instantly share code, notes, and snippets.

@micha
Created Jun 25, 2015
Embed
What would you like to do?
(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