Files
cms-server/justfile
Asai Neko f17c88547b
All checks were successful
Server Check Build (NixCN CMS) TeamCity build finished
Remove client components from devenv and justfile
Signed-off-by: Asai Neko <sugar@sne.moe>
2026-02-18 14:17:34 +08:00

36 lines
1.2 KiB
Makefile

project_name := "nixcn-cms"
go_cmd := `realpath $(which go)`
project_dir := justfile_directory()
output_dir := join(project_dir, ".outputs")
server_exec_path := join(output_dir, project_name)
server_entry := "main.go"
install:
go install github.com/swaggo/swag/cmd/swag@latest
cd {{ project_dir }} && go mod tidy
generate:
cd {{ project_dir }} && go generate .
clean:
mkdir -p .outputs
find .outputs -mindepth 1 ! -path .outputs/config.yaml -exec rm -rf {} +
build:
{{ go_cmd }} build -o {{ server_exec_path }}{{ if os() == "windows" { ".exe" } else { "" } }} {{ server_entry }}
run:
cd {{ output_dir }} && CONFIG_PATH={{ output_dir }} {{ server_exec_path }}{{ if os() == "windows" { ".exe" } else { "" } }}
test:
cd {{ output_dir }} && CONFIG_PATH={{ output_dir }} GO_ENV=test go test -C .. ./...
watch:
watchexec -r -e go,yaml,tpl -i '.devenv/**' -i '.direnv/**' -i 'client/**' -i 'vendor/**' 'go build -o {{ server_exec_path }} . && cd {{ output_dir }} && CONFIG_PATH={{ output_dir }} {{ server_exec_path }}'
dev: clean install generate
devenv up --verbose
back: clean install generate
devenv up postgres redis lgtm --verbose