Created
June 25, 2015 14:26
-
-
Save micha/3fff1e472f730ea8b22f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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