-
-
Save dball/a98c18cbbcc0faf61a37b750eb668dbd 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
(c/deftask push-config | |
"Pushes the output resources as config to AWS" | |
[e env VAL str "The environment" | |
n name VAL str "The application name"] | |
(let [s3-config (find-s3-config! env) | |
{:strs [bucket]} s3-config | |
path (format "apps/%s/env/%s/config" name env) | |
s3-url (format "s3://%s/%s" bucket path) | |
tmp (c/tmp-dir!) | |
sync! (#'c/fileset-syncer [tmp] :clean true :link false)] | |
(fn middleware [next-handler] | |
(fn handler [fileset] | |
(sync! fileset) | |
(let [args ["aws" "s3" "cp" (.getAbsolutePath tmp) s3-url "--recursive"]] | |
(apply util/dosh args)) | |
(next-handler fileset))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment