Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

6 Commits

Repository files navigation

boot-front

a boot task for invalidating cloudfront paths.

[tailrecursion/boot-front "1.1.0"] ;; latest release

overview

this task inspects the fileset's metadata to identify files that were uploaded by preceeding tasks as indicated by a keyword with the name "uploaded", then invalidates their corresponding paths (see boot-bucket).

usage

excerpt of a build.boot file using boot-front with boot-bucket for deployment.

(require
'[adzerk.boot-cljs :refer [cljs]]
'[adzerk.boot-reload :refer [reload]]
'[hoplon.boot-hoplon :refer [hoplon]]
'[tailrecursion.boot-bucket :refer [spew]]
'[tailrecursion.boot-front :refer [burst]]
'[tailrecursion.boot-static :refer [serve]])
(defbuckets
{:production"<appname>-production-application":staging"<appname>-staging-application"})
(defdistributions
{:production"<production-cloudfront-id>":staging"<staging-cloudfront-id>"})
(deftaskdevelop"Continuously rebuild the application during development."
[o optimizations OPM kw "Optimizations to pass the cljs compiler."]
(let [o (or optimizations :none)]
(comp (watch) (speak) (hoplon) (target) (reload) (cljs:optimizations o) (serve))))
(deftaskbuild"Build the application with advanced optimizations."
[o optimizations OPM kw "Optimizations to pass the cljs compiler."]
(let [o (or optimizations :advanced)]
(comp (speak) (hoplon) (cljs:optimizations o :compiler-options {:elide-assertstrue}) (sift))))
(deftaskdeploy"Build the application with advanced optimizations then deploy it to s3."
[e environment ENV kw "The application environment to be utilized by the service."
o optimizations OPM kw "Optimizations to pass the cljs compiler."]
(assert environment "Missing required environment argument.")
(let [b (buckets environment)
d (distributions environment)]
(comp (build:optimizations optimizations) (spew:bucket b) (burst:distribution d))))
(task-options!
serve {:port3001}
sift {:include #{#"index.html.out/"#"<app-ns>/"} :inverttrue}
spew {:access-key (System/getenv"<AWS_ACCESS_KEY_ENV_VAR>")
:secret-key (System/getenv"<AWS_SECRET_KEY_ENV_VAR>")}
burst {:access-key (System/getenv"<AWS_ACCESS_KEY_ENV_VAR>")
:secret-key (System/getenv"<AWS_SECRET_KEY_ENV_VAR>")})

About

task for invalidating amazon web services (aws) cloudfront paths.

Resources

Stars

0 stars

Watchers

15 watching

Forks

Releases

Packages

Contributors

Languages