This repository has been archived by the owner on Apr 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject.clj
175 lines (155 loc) · 7.77 KB
/
project.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
(defproject open-company-search "0.1.0-SNAPSHOT"
:description "A REST API to search Open Company content. Uses Elasticsearch."
:url "http://github.com/open-company/open-company-search"
:license {
:name "GNU Affero General Public License Version 3"
:url "https://www.gnu.org/licenses/agpl-3.0.en.html"
}
:min-lein-version "2.9.1"
;; JVM memory
:jvm-opts ^:replace ["-Xms512m" "-Xmx3072m" "-server"]
:dependencies [
[org.clojure/clojure "1.10.1-RC1"]
;; Async programming tools https://github.com/ztellman/manifold
[manifold "0.1.9-alpha3"]
;; Namespace management https://github.com/clojure/tools.namespace
;; NB: org.clojure/tools.reader is pulled in by oc.lib
[org.clojure/tools.namespace "0.3.0-alpha4" :exclusions [org.clojure/tools.reader]]
[ring/ring-devel "1.7.1"] ; Web application library https://github.com/ring-clojure/ring
[ring/ring-core "1.7.1"] ; Web application library https://github.com/ring-clojure/ring
[ring/ring-json "0.5.0-beta1"] ; JSON request/response https://github.com/ring-clojure/ring-json
[jumblerg/ring.middleware.cors "1.0.1"] ; CORS library https://github.com/jumblerg/ring.middleware.cors
[ring-logger-timbre "0.7.6" :exclusions [com.taoensso/encore]] ; Ring logging https://github.com/nberger/ring-logger-timbre
[compojure "1.6.1"] ; Web routing https://github.com/weavejester/compojure
[slingshot "0.12.2"] ; Enhanced try/catch https://github.com/scgilardi/slingshot
;; Library for Elasticsearch http://clojureelasticsearch.info/
;; NB: cheshire is provided by oc.lib
[clojurewerkz/elastisch "3.0.1" :exclusions [cheshire]]
;; Pull in fasterxml directly to avoid conflicts
[com.fasterxml.jackson.core/jackson-databind "2.11.2"]
;; Library for OC projects https://github.com/open-company/open-company-lib
;; ************************************************************************
;; ****************** NB: don't go under 0.17.29-alpha60 ******************
;; ***************** (JWT schema changes, more info here: *****************
;; ******* https://github.com/open-company/open-company-lib/pull/82) ******
;; ************************************************************************
[open-company/lib "0.19.0-alpha5"]
;; ************************************************************************
;; In addition to common functions, brings in the following common dependencies used by this project:
;; Component - Component Lifecycle https://github.com/stuartsierra/component
;; Schema - Data validation https://github.com/Prismatic/schema
;; Timbre - Pure Clojure/Script logging library https://github.com/ptaoussanis/timbre
;; Amazonica - A comprehensive Clojure client for the AWS API https://github.com/mcohen01/amazonica
;; Raven - Interface to Sentry error reporting https://github.com/sethtrain/raven-clj
;; Cheshire - JSON encoding / decoding https://github.com/dakrone/cheshire
;; clj-time - Date and time lib https://github.com/clj-time/clj-time
;; Environ - Get environment settings from different sources https://github.com/weavejester/environ]
]
:target-path "target/%s"
;; All profile plugins
:plugins [
[lein-environ "1.1.0"] ; Get environment settings from different sources https://github.com/weavejester/environ
]
:profiles {
;; QA environment and dependencies
:qa {
:env {
}
:plugins [
;; Linter https://github.com/jonase/eastwood
[jonase/eastwood "0.3.5"]
;; Static code search for non-idiomatic code https://github.com/jonase/kibit
[lein-kibit "0.1.6" :exclusions [org.clojure/clojure]]
]
}
;; Dev environment and dependencies
:dev [:qa {
:env ^:replace {
:liberator-trace "true" ; liberator debug data in HTTP response headers
:hot-reload "true" ; reload code when changed on the file system
:open-company-auth-passphrase "this_is_a_dev_secret" ; JWT secret
:aws-access-key-id "CHANGE-ME"
:aws-secret-access-key "CHANGE-ME"
:aws-endpoint "us-east-1"
:aws-sqs-search-index-queue "https://sqs.REGION.amazonaws.com/CHANGE/ME"
:elastic-search-endpoint "http://localhost:9200" ; "https://ESDOMAIN.us-east-1.es.amazonaws.com/ESDOMAIN"
:elastic-search-index "CHANGE-ME"
:intro "true"
:log-level "debug"
}
:dependencies [
[hickory "0.7.1"] ; HTML as data https://github.com/davidsantiago/hickory
]
:plugins [
;; Check for code smells https://github.com/dakrone/lein-bikeshed
;; NB: org.clojure/tools.cli is pulled in by lein-kibit
[lein-bikeshed "0.5.2" :exclusions [org.clojure/tools.cli]]
;; Runs bikeshed, kibit and eastwood https://github.com/itang/lein-checkall
[lein-checkall "0.1.1"]
;; pretty-print the lein project map https://github.com/technomancy/leiningen/tree/master/lein-pprint
[lein-pprint "1.2.0"]
;; Check for outdated dependencies https://github.com/xsc/lein-ancient
[lein-ancient "0.6.15"]
;; Catch spelling mistakes in docs and docstrings https://github.com/cldwalker/lein-spell
[lein-spell "0.1.0"]
;; Dead code finder https://github.com/venantius/yagni
[venantius/yagni "0.1.7" :exclusions [org.clojure/clojure]]
;; Autotest https://github.com/jakemcc/lein-test-refresh
[com.jakemccrary/lein-test-refresh "0.24.1"]
]
}]
:repl-config [:dev {
:dependencies [
[org.clojure/tools.nrepl "0.2.13"] ; Network REPL https://github.com/clojure/tools.nrepl
[aprint "0.1.3"] ; Pretty printing in the REPL (aprint ...) https://github.com/razum2um/aprint
]
;; REPL injections
:injections [
(require '[aprint.core :refer (aprint ap)]
'[clojure.stacktrace :refer (print-stack-trace)]
'[clojure.string :as s]
'[clj-time.core :as t]
'[clj-time.format :as f]
'[cheshire.core :as json]
'[hiccup.core :as h]
'[hickory.core :as hickory]
'[oc.search.config :as c])
]
}]
;; Production environment
:prod {}
:uberjar {
:aot :all
}
}
:repl-options {
:welcome (println (str "\n" (slurp (clojure.java.io/resource "oc/assets/ascii_art.txt")) "\n"
"OpenCompany Search Service REPL\n"
"\nReady to do your bidding... I suggest (go) or (go <port>) as your first command.\n"))
:init-ns dev
}
:aliases {
"build" ["with-profile" "prod" "do" "clean," "uberjar"] ; clean and build code
"repl" ["with-profile" "+repl-config" "repl"]
"start" ["run" "-m" "oc.search.app"] ; start a development server
"start!" ["with-profile" "prod" "do" "start"] ; start a server in production
"spell!" ["spell" "-n"] ; check spelling in docs and docstrings
"bikeshed!" ["bikeshed" "-v" "-m" "120"] ; code check with max line length warning of 120 characters
"ancient" ["ancient" ":all" ":allow-qualified"] ; check for out of date dependencies
}
;; ----- Code check configuration -----
:eastwood {
;; Disable some linters that are enabled by default
;; constant-test - just seems mostly ill-advised, logical constants are useful in something like a `->cond`
;; wrong-arity - unfortunate, but it's failing on 3/arity of sqs/send-message
;; implicit-dependencies - uhh, just seems dumb
:exclude-linters [:constant-test :wrong-arity :implicit-dependencies]
;; Enable some linters that are disabled by default
:add-linters [:unused-namespaces :unused-private-vars :unused-locals]
:config-files ["third-party-macros.clj"]
;; Exclude testing namespaces
:tests-paths ["test"]
:exclude-namespaces [:test-paths]
}
:main oc.search.app
)