Working towards lein-adl
This commit is contained in:
parent
3b11b678a1
commit
912d417cb6
3
env/prod/resources/config.edn
vendored
3
env/prod/resources/config.edn
vendored
|
@ -2,4 +2,5 @@
|
||||||
:port 8765
|
:port 8765
|
||||||
:site-title "Project Hope"
|
:site-title "Project Hope"
|
||||||
:site-logo "img/ProjectHopeLogo.png"
|
:site-logo "img/ProjectHopeLogo.png"
|
||||||
:motd "motd.md"}
|
:motd "motd.md"
|
||||||
|
:app-context "/youyesyet"}
|
||||||
|
|
32
project.clj
32
project.clj
|
@ -54,7 +54,8 @@
|
||||||
:main ^:skip-aot youyesyet.core
|
:main ^:skip-aot youyesyet.core
|
||||||
:migratus {:store :database :db ~(get (System/getenv) "DATABASE_URL")}
|
:migratus {:store :database :db ~(get (System/getenv) "DATABASE_URL")}
|
||||||
|
|
||||||
:plugins [[lein-cljsbuild "1.1.4"]
|
:plugins [[lein-adl ["0.1.1"]]
|
||||||
|
[lein-cljsbuild "1.1.4"]
|
||||||
[lein-codox "0.10.3"]
|
[lein-codox "0.10.3"]
|
||||||
[lein-cprop "1.0.1"]
|
[lein-cprop "1.0.1"]
|
||||||
[lein-less "1.7.5"]
|
[lein-less "1.7.5"]
|
||||||
|
@ -64,7 +65,6 @@
|
||||||
[migratus-lein "0.4.2"]
|
[migratus-lein "0.4.2"]
|
||||||
[org.clojars.punkisdead/lein-cucumber "1.0.5"]]
|
[org.clojars.punkisdead/lein-cucumber "1.0.5"]]
|
||||||
|
|
||||||
|
|
||||||
:cucumber-feature-paths ["test/clj/features"]
|
:cucumber-feature-paths ["test/clj/features"]
|
||||||
|
|
||||||
:codox {:metadata {:doc "FIXME: write docs"}
|
:codox {:metadata {:doc "FIXME: write docs"}
|
||||||
|
@ -82,36 +82,34 @@
|
||||||
|
|
||||||
:release-tasks [["vcs" "assert-committed"]
|
:release-tasks [["vcs" "assert-committed"]
|
||||||
["change" "version" "leiningen.release/bump-version" "release"]
|
["change" "version" "leiningen.release/bump-version" "release"]
|
||||||
|
["adl"]
|
||||||
["vcs" "commit"]
|
["vcs" "commit"]
|
||||||
;; ["vcs" "tag"] -- not working, problems with secret key
|
;; ["vcs" "tag"] -- not working, problems with secret key
|
||||||
["clean"]
|
["clean"]
|
||||||
["npm" "install"]
|
["npm" "install"]
|
||||||
["ring" "uberjar"]
|
["uberjar"]
|
||||||
|
[uberwar]
|
||||||
["docker" "build"]
|
["docker" "build"]
|
||||||
["docker" "push"]
|
["docker" "push"]
|
||||||
["change" "version" "leiningen.release/bump-version"]
|
["change" "version" "leiningen.release/bump-version"]
|
||||||
["vcs" "commit"]]
|
["vcs" "commit"]]
|
||||||
|
|
||||||
:uberwar
|
:uberwar {:handler youyesyet.handler/app
|
||||||
{:handler youyesyet.handler/app
|
|
||||||
:init youyesyet.handler/init
|
:init youyesyet.handler/init
|
||||||
:destroy youyesyet.handler/destroy
|
:destroy youyesyet.handler/destroy
|
||||||
:name "youyesyet.war"}
|
:name "youyesyet.war"}
|
||||||
|
|
||||||
:clean-targets ^{:protect false}
|
:clean-targets ^{:protect false} [:target-path [:cljsbuild :builds :app :compiler :output-dir]
|
||||||
[:target-path [:cljsbuild :builds :app :compiler :output-dir]
|
|
||||||
[:cljsbuild :builds :app :compiler :output-to]]
|
[:cljsbuild :builds :app :compiler :output-to]]
|
||||||
|
|
||||||
:figwheel
|
:figwheel {:http-server-root "public"
|
||||||
{:http-server-root "public"
|
|
||||||
:nrepl-port 7002
|
:nrepl-port 7002
|
||||||
:css-dirs ["resources/public/css"]
|
:css-dirs ["resources/public/css"]
|
||||||
:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}
|
:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}
|
||||||
|
|
||||||
|
|
||||||
:profiles
|
:profiles {:uberjar {:omit-source true
|
||||||
{:uberjar {:omit-source true
|
:prep-tasks ["adl" "compile" ["cljsbuild" "once" "min"]]
|
||||||
:prep-tasks ["compile" ["cljsbuild" "once" "min"]]
|
|
||||||
:cljsbuild
|
:cljsbuild
|
||||||
{:builds
|
{:builds
|
||||||
{:min
|
{:min
|
||||||
|
@ -123,14 +121,13 @@
|
||||||
:closure-warnings
|
:closure-warnings
|
||||||
{:externs-validation :off :non-standard-jsdoc :off}
|
{:externs-validation :off :non-standard-jsdoc :off}
|
||||||
:externs ["react/externs/react.js"]}}}}
|
:externs ["react/externs/react.js"]}}}}
|
||||||
|
|
||||||
|
|
||||||
:aot :all
|
:aot :all
|
||||||
:uberjar-name "youyesyet.jar"
|
:uberjar-name "youyesyet.jar"
|
||||||
:source-paths ["env/prod/clj"]
|
:source-paths ["env/prod/clj"]
|
||||||
:resource-paths ["env/prod/resources"]}
|
:resource-paths ["env/prod/resources"]}
|
||||||
|
|
||||||
:dev [:project/dev :profiles/dev]
|
:dev [:project/dev :profiles/dev]
|
||||||
|
|
||||||
:test [:project/dev :project/test :profiles/test]
|
:test [:project/dev :project/test :profiles/test]
|
||||||
|
|
||||||
:project/dev {:dependencies [[prone "1.1.4"]
|
:project/dev {:dependencies [[prone "1.1.4"]
|
||||||
|
@ -148,8 +145,7 @@
|
||||||
[lein-doo "0.1.7"]
|
[lein-doo "0.1.7"]
|
||||||
[lein-figwheel "0.5.15"]
|
[lein-figwheel "0.5.15"]
|
||||||
[org.clojure/clojurescript "1.9.495"]]
|
[org.clojure/clojurescript "1.9.495"]]
|
||||||
:cljsbuild
|
:cljsbuild {:builds
|
||||||
{:builds
|
|
||||||
{:app
|
{:app
|
||||||
{:source-paths ["src/cljs" "src/cljc" "env/dev/cljs"]
|
{:source-paths ["src/cljs" "src/cljc" "env/dev/cljs"]
|
||||||
:compiler
|
:compiler
|
||||||
|
@ -175,8 +171,6 @@
|
||||||
{:output-to "target/test.js"
|
{:output-to "target/test.js"
|
||||||
:main "youyesyet.doo-runner"
|
:main "youyesyet.doo-runner"
|
||||||
:optimizations :whitespace
|
:optimizations :whitespace
|
||||||
:pretty-print true}}}}
|
:pretty-print true}}}}}
|
||||||
|
|
||||||
}
|
|
||||||
:profiles/dev {}
|
:profiles/dev {}
|
||||||
:profiles/test {}})
|
:profiles/test {}})
|
||||||
|
|
|
@ -21,13 +21,16 @@
|
||||||
;; .getContextPath might not exist
|
;; .getContextPath might not exist
|
||||||
(try (.getContextPath ^ServletContext context)
|
(try (.getContextPath ^ServletContext context)
|
||||||
(catch IllegalArgumentException err
|
(catch IllegalArgumentException err
|
||||||
(log/warn "Failed to initialise servlet-context: " (.getMessage err))
|
(log/warn "Failed to initialise *app-context*: " (.getMessage err))
|
||||||
context))
|
context))
|
||||||
;; if the context is not specified in the request
|
;; if the context is not specified in the request
|
||||||
;; we check if one has been specified in the environment
|
;; we check if one has been specified in the environment
|
||||||
;; instead
|
;; instead
|
||||||
(:app-context env))]
|
(do
|
||||||
(handler request))))
|
(log/info "Taking '" (:app-context env) "' as *app-context* from env")
|
||||||
|
(:app-context env)))]
|
||||||
|
(log/debug "Using '" *app-context* "' as *app-context*")
|
||||||
|
(handler (assoc request :servlet-context *app-context*)))))
|
||||||
|
|
||||||
|
|
||||||
(defn wrap-internal-error [handler]
|
(defn wrap-internal-error [handler]
|
||||||
|
|
Loading…
Reference in a new issue