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"}
|
||||||
|
|
162
project.clj
162
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,101 +82,95 @@
|
||||||
|
|
||||||
: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
|
{:source-paths ["src/cljc" "src/cljs" "env/prod/cljs"]
|
||||||
{:source-paths ["src/cljc" "src/cljs" "env/prod/cljs"]
|
:compiler
|
||||||
:compiler
|
{:output-to "target/cljsbuild/public/js/app.js"
|
||||||
{:output-to "target/cljsbuild/public/js/app.js"
|
:optimizations :advanced
|
||||||
:optimizations :advanced
|
:pretty-print false
|
||||||
:pretty-print false
|
: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
|
||||||
|
:uberjar-name "youyesyet.jar"
|
||||||
|
:source-paths ["env/prod/clj"]
|
||||||
|
:resource-paths ["env/prod/resources"]}
|
||||||
|
|
||||||
|
:dev [:project/dev :profiles/dev]
|
||||||
|
|
||||||
:aot :all
|
:test [:project/dev :project/test :profiles/test]
|
||||||
:uberjar-name "youyesyet.jar"
|
|
||||||
:source-paths ["env/prod/clj"]
|
|
||||||
:resource-paths ["env/prod/resources"]}
|
|
||||||
|
|
||||||
:dev [:project/dev :profiles/dev]
|
:project/dev {:dependencies [[prone "1.1.4"]
|
||||||
:test [:project/dev :project/test :profiles/test]
|
[ring/ring-mock "0.3.0"]
|
||||||
|
[ring/ring-devel "1.5.1"]
|
||||||
:project/dev {:dependencies [[prone "1.1.4"]
|
[org.webjars/webjars-locator-jboss-vfs "0.1.0"]
|
||||||
[ring/ring-mock "0.3.0"]
|
[luminus-immutant "0.2.3"]
|
||||||
[ring/ring-devel "1.5.1"]
|
[pjstadig/humane-test-output "0.8.1"]
|
||||||
[org.webjars/webjars-locator-jboss-vfs "0.1.0"]
|
[binaryage/devtools "0.9.2"]
|
||||||
[luminus-immutant "0.2.3"]
|
[com.cemerick/piggieback "0.2.2-SNAPSHOT"]
|
||||||
[pjstadig/humane-test-output "0.8.1"]
|
[directory-naming/naming-java "0.8"]
|
||||||
[binaryage/devtools "0.9.2"]
|
[doo "0.1.7"]
|
||||||
[com.cemerick/piggieback "0.2.2-SNAPSHOT"]
|
[figwheel-sidecar "0.5.15"]]
|
||||||
[directory-naming/naming-java "0.8"]
|
:plugins [[com.jakemccrary/lein-test-refresh "0.18.1"]
|
||||||
[doo "0.1.7"]
|
[lein-doo "0.1.7"]
|
||||||
[figwheel-sidecar "0.5.15"]]
|
[lein-figwheel "0.5.15"]
|
||||||
:plugins [[com.jakemccrary/lein-test-refresh "0.18.1"]
|
[org.clojure/clojurescript "1.9.495"]]
|
||||||
[lein-doo "0.1.7"]
|
:cljsbuild {:builds
|
||||||
[lein-figwheel "0.5.15"]
|
{:app
|
||||||
[org.clojure/clojurescript "1.9.495"]]
|
{:source-paths ["src/cljs" "src/cljc" "env/dev/cljs"]
|
||||||
:cljsbuild
|
:compiler
|
||||||
{:builds
|
{:main "youyesyet.canvasser-app.app"
|
||||||
{:app
|
:asset-path "/js/out"
|
||||||
{:source-paths ["src/cljs" "src/cljc" "env/dev/cljs"]
|
:output-to "target/cljsbuild/public/js/app.js"
|
||||||
:compiler
|
:output-dir "target/cljsbuild/public/js/out"
|
||||||
{:main "youyesyet.canvasser-app.app"
|
:source-map true
|
||||||
:asset-path "/js/out"
|
:optimizations :none
|
||||||
:output-to "target/cljsbuild/public/js/app.js"
|
:pretty-print true}}}}
|
||||||
:output-dir "target/cljsbuild/public/js/out"
|
:doo {:build "test"}
|
||||||
:source-map true
|
:source-paths ["env/dev/clj"]
|
||||||
:optimizations :none
|
:resource-paths ["env/dev/resources"]
|
||||||
:pretty-print true}}}}
|
:repl-options {:init-ns user}
|
||||||
:doo {:build "test"}
|
:injections [(require 'pjstadig.humane-test-output)
|
||||||
:source-paths ["env/dev/clj"]
|
(pjstadig.humane-test-output/activate!)]}
|
||||||
:resource-paths ["env/dev/resources"]
|
:project/test {:resource-paths ["env/test/resources"]
|
||||||
:repl-options {:init-ns user}
|
:cljsbuild
|
||||||
:injections [(require 'pjstadig.humane-test-output)
|
{:builds
|
||||||
(pjstadig.humane-test-output/activate!)]}
|
{:test
|
||||||
:project/test {:resource-paths ["env/test/resources"]
|
{:source-paths ["src/cljc" "src/cljs" "test/cljs"]
|
||||||
:cljsbuild
|
:compiler
|
||||||
{:builds
|
{:output-to "target/test.js"
|
||||||
{:test
|
:main "youyesyet.doo-runner"
|
||||||
{:source-paths ["src/cljc" "src/cljs" "test/cljs"]
|
:optimizations :whitespace
|
||||||
:compiler
|
:pretty-print true}}}}}
|
||||||
{:output-to "target/test.js"
|
:profiles/dev {}
|
||||||
:main "youyesyet.doo-runner"
|
:profiles/test {}})
|
||||||
:optimizations :whitespace
|
|
||||||
:pretty-print true}}}}
|
|
||||||
|
|
||||||
}
|
|
||||||
:profiles/dev {}
|
|
||||||
:profiles/test {}})
|
|
||||||
|
|
|
@ -20,14 +20,17 @@
|
||||||
;; (for example when using mock requests), then
|
;; (for example when using mock requests), then
|
||||||
;; .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