Remove client components from devenv and justfile
All checks were successful
Server Check Build (NixCN CMS) TeamCity build finished
All checks were successful
Server Check Build (NixCN CMS) TeamCity build finished
Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
@@ -26,18 +26,12 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
version = "1.25.5";
|
version = "1.25.5";
|
||||||
};
|
};
|
||||||
javascript.enable = true;
|
|
||||||
javascript.corepack.enable = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
env.PODMAN_COMPOSE_PROVIDER = "none";
|
env.PODMAN_COMPOSE_PROVIDER = "none";
|
||||||
|
|
||||||
processes = {
|
processes = {
|
||||||
client-cms = {
|
server.exec = "sleep 30 && just watch";
|
||||||
exec = "pnpm run dev";
|
|
||||||
cwd = "./client/cms";
|
|
||||||
};
|
|
||||||
backend.exec = "sleep 30 && just watch-back";
|
|
||||||
lgtm.exec = ''
|
lgtm.exec = ''
|
||||||
podman rm -f lgtm || true
|
podman rm -f lgtm || true
|
||||||
podman run --name lgtm \
|
podman run --name lgtm \
|
||||||
|
|||||||
37
justfile
37
justfile
@@ -1,52 +1,35 @@
|
|||||||
project_name := "nixcn-cms"
|
project_name := "nixcn-cms"
|
||||||
go_cmd := `realpath $(which go)`
|
go_cmd := `realpath $(which go)`
|
||||||
pnpm_cmd := `realpath $(which pnpm)`
|
|
||||||
project_dir := justfile_directory()
|
project_dir := justfile_directory()
|
||||||
output_dir := join(project_dir, ".outputs")
|
output_dir := join(project_dir, ".outputs")
|
||||||
client_dir := join(project_dir, "client")
|
|
||||||
client_output_dir := join(output_dir, "client")
|
|
||||||
client_cms_dir := join(client_dir, "cms")
|
|
||||||
server_exec_path := join(output_dir, project_name)
|
server_exec_path := join(output_dir, project_name)
|
||||||
server_entry := "main.go"
|
server_entry := "main.go"
|
||||||
|
|
||||||
install: install-cms install-back
|
install:
|
||||||
|
go install github.com/swaggo/swag/cmd/swag@latest
|
||||||
|
cd {{ project_dir }} && go mod tidy
|
||||||
|
|
||||||
generate: gen-back
|
generate:
|
||||||
|
cd {{ project_dir }} && go generate .
|
||||||
install-cms:
|
|
||||||
cd {{ client_cms_dir }} && {{ pnpm_cmd }} install
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
mkdir -p .outputs
|
mkdir -p .outputs
|
||||||
find .outputs -mindepth 1 ! -path .outputs/config.yaml -exec rm -rf {} +
|
find .outputs -mindepth 1 ! -path .outputs/config.yaml -exec rm -rf {} +
|
||||||
|
|
||||||
build-client-cms:
|
build:
|
||||||
cd {{ client_cms_dir }} && {{ pnpm_cmd }} run build --outDir {{ join(client_output_dir, "cms") }}
|
|
||||||
|
|
||||||
build-back:
|
|
||||||
{{ go_cmd }} build -o {{ server_exec_path }}{{ if os() == "windows" { ".exe" } else { "" } }} {{ server_entry }}
|
{{ go_cmd }} build -o {{ server_exec_path }}{{ if os() == "windows" { ".exe" } else { "" } }} {{ server_entry }}
|
||||||
|
|
||||||
install-back:
|
run:
|
||||||
go install github.com/swaggo/swag/cmd/swag@latest
|
|
||||||
cd {{ project_dir }} && go mod tidy
|
|
||||||
|
|
||||||
run-back:
|
|
||||||
cd {{ output_dir }} && CONFIG_PATH={{ output_dir }} {{ server_exec_path }}{{ if os() == "windows" { ".exe" } else { "" } }}
|
cd {{ output_dir }} && CONFIG_PATH={{ output_dir }} {{ server_exec_path }}{{ if os() == "windows" { ".exe" } else { "" } }}
|
||||||
|
|
||||||
test-back:
|
test:
|
||||||
cd {{ output_dir }} && CONFIG_PATH={{ output_dir }} GO_ENV=test go test -C .. ./...
|
cd {{ output_dir }} && CONFIG_PATH={{ output_dir }} GO_ENV=test go test -C .. ./...
|
||||||
|
|
||||||
gen-back:
|
watch:
|
||||||
cd {{ project_dir }} && go generate .
|
|
||||||
|
|
||||||
watch-back:
|
|
||||||
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 }}'
|
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
|
dev: clean install generate
|
||||||
devenv up --verbose
|
devenv up --verbose
|
||||||
|
|
||||||
dev-client-cms: install-cms
|
back: clean install generate
|
||||||
devenv up client-cms --verbose
|
|
||||||
|
|
||||||
dev-back: clean install-back gen-back
|
|
||||||
devenv up postgres redis lgtm --verbose
|
devenv up postgres redis lgtm --verbose
|
||||||
|
|||||||
Reference in New Issue
Block a user