Improve config (json) file creation
This commit is contained in:
parent
1d4e9efa15
commit
525eb21649
6 changed files with 91 additions and 84 deletions
1
.env
1
.env
|
@ -1 +0,0 @@
|
|||
DATABASE_URL="sqlite://emgauwa-dev.sqlite"
|
19
.gitignore
vendored
19
.gitignore
vendored
|
@ -1,15 +1,8 @@
|
|||
/target/
|
||||
|
||||
/tests/testing/
|
||||
/tests/testing_bak/
|
||||
/tests/testing_latest/
|
||||
|
||||
emgauwa-*.sqlite
|
||||
emgauwa-*.sqlite-*
|
||||
emgauwa-*.json
|
||||
|
||||
|
||||
# Added by cargo
|
||||
|
||||
/target
|
||||
|
||||
/.env
|
||||
/api.http
|
||||
|
||||
/emgauwa-*.sqlite
|
||||
/emgauwa-*.sqlite-*
|
||||
/emgauwa-*.json
|
19
Makefile
19
Makefile
|
@ -1,5 +1,13 @@
|
|||
ifneq (,$(wildcard ./.env))
|
||||
include .env
|
||||
export
|
||||
endif
|
||||
|
||||
DATABASE_URL ?= sqlite://emgauwa-dev.sqlite
|
||||
export DATABASE_URL
|
||||
|
||||
sqlx:
|
||||
cargo sqlx database drop
|
||||
cargo sqlx database drop -y
|
||||
cargo sqlx database create
|
||||
cargo sqlx migrate run
|
||||
cargo sqlx prepare --workspace
|
||||
|
@ -7,9 +15,16 @@ sqlx:
|
|||
build-rpi:
|
||||
cross build --target arm-unknown-linux-gnueabihf
|
||||
|
||||
emgauwa-%.json: config/emgauwa-%.pkl config/lib/%.pkl config/lib/common.pkl
|
||||
emgauwa-%.json: config/emgauwa-%.pkl config/lib/%.pkl config/lib/common.pkl $(wildcard .env)
|
||||
pkl eval -f json -o $@ $<
|
||||
|
||||
configs:
|
||||
$(MAKE) emgauwa-core.json
|
||||
$(MAKE) emgauwa-controller.json
|
||||
|
||||
clean:
|
||||
rm -f emgauwa-controller.json
|
||||
rm -f emgauwa-controller.sqlite
|
||||
rm -f emgauwa-core.json
|
||||
rm -f emgauwa-core.sqlite
|
||||
rm -f emgauwa-dev.sqlite
|
|
@ -13,7 +13,7 @@ permissions {
|
|||
}
|
||||
|
||||
logging {
|
||||
level = "DEBUG"
|
||||
level = read?("env:LOGGING_LEVEL") ?? "DEBUG"
|
||||
file = "stdout"
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,6 @@ permissions {
|
|||
}
|
||||
|
||||
logging {
|
||||
level = "DEBUG"
|
||||
level = read?("env:LOGGING_LEVEL") ?? "DEBUG"
|
||||
file = "stdout"
|
||||
}
|
||||
|
|
|
@ -10,6 +10,6 @@ class PermissionsConfig {
|
|||
}
|
||||
|
||||
class LoggingConfig {
|
||||
level: String
|
||||
level: "TRACE"|"DEBUG"|"INFO"|"WARN"|"ERROR"|"FATAL"
|
||||
file: String
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue