Skip to content

Instantly share code, notes, and snippets.

@minimal
Last active September 21, 2016 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minimal/f64f7fd375ea0335ac15b8d6893ff817 to your computer and use it in GitHub Desktop.
Save minimal/f64f7fd375ea0335ac15b8d6893ff817 to your computer and use it in GitHub Desktop.
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