-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathmise.toml
More file actions
180 lines (143 loc) · 5.82 KB
/
Copy pathmise.toml
File metadata and controls
180 lines (143 loc) · 5.82 KB
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
176
177
178
179
180
# Mise file (https://mise.jdx.dev/) for otoroshi
#
# setup: mise install && mise run install-js-deps
# dev: mise run dev
# test: mise run test
# build: mise run build
# format: mise run fmt
# doc: mise run dev-doc
# ─── Tools ───────────────────────────────────────────────────────────
[tools]
java = "openjdk-17"
sbt = "1.7.2"
node = "22"
# ─── Install ─────────────────────────────────────────────────────────
[tasks.install-frontend-js-deps]
description = "Install frontend JS dependencies"
dir = "otoroshi/javascript"
run = "npm install --legacy-peer-deps"
[tasks.install-doc-js-deps]
description = "Install documentation JS dependencies"
dir = "manual/next"
run = "npm install"
[tasks.install-js-deps]
description = "Install all JS dependencies (frontend + doc)"
run = [
{ task = "install-frontend-js-deps" },
{ task = "install-doc-js-deps"}
]
# ─── Development ─────────────────────────────────────────────────────
[tasks.dev-backend]
description = "Run otoroshi backend in dev mode (sbt ~reStart, hot reload)"
dir = "otoroshi"
run = "sbt -J-Xmx2G --java-home $JAVA_HOME ~reStart"
[tasks.dev-backend.env]
#OTOROSHI_INITIAL_ADMIN_LOGIN = "admin@otoroshi.io"
#OTOROSHI_INITIAL_ADMIN_PASSWORD = "password"
#OTOROSHI_API_CLIENT_ID = "admin"
#OTOROSHI_API_CLIENT_SECRET = "secret"
[tasks.dev-frontend]
description = "Start frontend webpack dev server (port 3040)"
dir = "otoroshi/javascript"
run = "npm run webpack:start"
[tasks.dev-doc]
description = "Run documentation Docusaurus dev server"
dir = "manual/next"
run = "npm run start"
[tasks.dev]
description = "Start backend + frontend in dev mode"
depends = ["dev-backend", "dev-frontend"]
run = "true"
[tasks.dev-w-doc]
description = "Start backend + frontend + doc in dev mode"
depends = ["dev-backend", "dev-frontend", "dev-doc"]
run = "true"
# ─── Build ───────────────────────────────────────────────────────────
[tasks.compile]
description = "Compile Scala backend (no assembly)"
dir = "otoroshi"
run = "sbt --java-home $JAVA_HOME clean compile"
[tasks.build-backend]
description = "Build otoroshi backend jar (compile + assembly)"
dir = "otoroshi"
run = "sbt --java-home $JAVA_HOME clean compile assembly"
[tasks.build-frontend]
description = "Build otoroshi frontend (webpack production)"
dir = "otoroshi/javascript"
run = "npm run webpack:build"
[tasks.build-doc]
description = "Build the documentation static site"
dir = "manual/next"
run = "npm run build"
[tasks.build]
description = "Build otoroshi (frontend + backend jar)"
run = [
{ task = "build-frontend" },
{ task = "build-backend" }
]
[tasks.build-w-doc]
description = "Build otoroshi (frontend + backend + doc)"
run = [
{ task = "build-frontend" },
{ task = "build-backend" },
{ task = "build-doc" }
]
# ─── Run ─────────────────────────────────────────────────────────────
[tasks.jar]
description = "Run the built otoroshi jar locally"
dir = "otoroshi"
run = "$JAVA_HOME/bin/java -jar target/scala-2.12/otoroshi.jar"
[tasks.jar.env]
PORT = "8080"
OTOROSHI_STORAGE = "file"
OTOROSHI_ENV = "prod"
OTOROSHI_INITIAL_ADMIN_LOGIN = "admin@otoroshi.io"
OTOROSHI_INITIAL_ADMIN_PASSWORD = "password"
OTOROSHI_API_CLIENT_ID = "admin"
OTOROSHI_API_CLIENT_SECRET = "secret"
OTOROSHI_DOMAIN = "oto.tools"
# ─── Test ────────────────────────────────────────────────────────────
[tasks.test]
description = "Run the main backend test suite (OtoroshiTests)"
dir = "otoroshi"
run = "sbt --java-home $JAVA_HOME 'testOnly OtoroshiTests'"
[tasks.test.env]
TEST_STORE = "inmemory"
[tasks.test-plugins]
description = "Run the plugins test suite"
dir = "otoroshi"
run = "sbt --java-home $JAVA_HOME 'testOnly functional.PluginsTestSpec'"
[tasks.test-plugins.env]
TEST_STORE = "inmemory"
[tasks.test-all]
description = "Run all backend tests (main + plugins)"
dir = "otoroshi"
run = "sbt --java-home $JAVA_HOME 'testOnly OtoroshiTests' 'testOnly functional.PluginsTestSpec'"
[tasks.test-all.env]
TEST_STORE = "inmemory"
[tasks.test-e2e]
description = "Run Playwright end-to-end tests (requires running otoroshi)"
dir = "otoroshi/javascript"
run = "npx playwright test"
# ─── Format ──────────────────────────────────────────────────────────
[tasks.fmt-frontend]
description = "Format frontend code with prettier"
dir = "otoroshi/javascript"
run = "npx prettier --write --single-quote --trailing-comma es5 --print-width 100 --tab-width 2 --jsx-bracket-same-line 'src/**/*.js'"
[tasks.fmt-backend]
description = "Format Scala code with scalafmt"
dir = "otoroshi"
run = "sbt --java-home $JAVA_HOME ';scalafmt;scalafmtSbt;test:scalafmt'"
[tasks.fmt]
description = "Format all code (frontend + backend)"
run = [
{ task = "fmt-frontend" },
{ task = "fmt-backend" }
]
# ─── Clean ───────────────────────────────────────────────────────────
[tasks.clean]
description = "Clean all build artifacts (backend + frontend + doc)"
run = [
"rm -rf otoroshi/target/scala-2.12/otoroshi.jar",
"rm -rf manual/next/build",
]