Skip to content

Instantly share code, notes, and snippets.

@minimal
Last active Sep 21, 2016
Embed
What would you like to do?
Clojurescript & boot app release version and sentry integration
(import
'[java.time ZonedDateTime]
'[java.time.format DateTimeFormatter])
;; add a RELEASE closure define with the current iso date, RAVEN_DSN from env var
(deftask production []
(task-options! cljs {:optimizations :advanced
:compiler-options {:closure-defines {"goog.DEBUG" false
"myapp.core.RAVEN_DSN" (System/getenv "RAVEN_DSN")
"myapp.core.RELEASE" (.. (ZonedDateTime/now)
(format DateTimeFormatter/ISO_INSTANT))}}
:source-map true})
identity)
(ns myapp.core)
(def RELEASE "@define {string}" "")
(def RAVEN_DSN "@define {string}" "")
(when-not ^boolean js/goog.DEBUG
(-> (js/Raven.config ^string myapp.core/RAVEN_DSN
#js {:release ^string myapp.core/RELEASE})
.install))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment