chore(make): simplify build/run targets and set local PG DSNs
This commit is contained in:
parent
8f79e708b0
commit
ea5b851768
44
Makefile
44
Makefile
@ -1,15 +1,15 @@
|
||||
OS := $(shell uname -s)
|
||||
SHELL := /bin/bash
|
||||
O_BIN ?= /usr/local/go/bin
|
||||
PG_DSN ?= postgres://user:password@127.0.0.1:5432/postgres
|
||||
PG_DSN ?= postgres://shenlan:password@127.0.0.1:5432/xserver?sslmode=disable
|
||||
NODE_MAJOR ?= 22
|
||||
|
||||
export PATH := $(GO_BIN):$(PATH)
|
||||
|
||||
.PHONY: install install-openresty install-redis install-postgresql install-pgvector install-zhparser init-db \
|
||||
build update-homepage-manifests build-server build-homepage build-panel build-dl build-docs \
|
||||
start start-openresty start-server start-homepage start-panel start-dl start-docs \
|
||||
stop stop-server stop-homepage stop-panel stop-dl stop-docs stop-openresty restart
|
||||
build update-homepage-manifests build-server build-homepage \
|
||||
start start-openresty start-server start-homepage \
|
||||
stop stop-server stop-homepage stop-openresty restart
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Dependency installation
|
||||
@ -94,7 +94,7 @@ init-db:
|
||||
# Build targets
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
build: update-homepage-manifests build-cli build-server build-homepage build-panel build-dl build-docs
|
||||
build: update-homepage-manifests build-cli build-server build-homepage
|
||||
|
||||
build-cli:
|
||||
$(MAKE) -C client build
|
||||
@ -103,25 +103,16 @@ build-server:
|
||||
$(MAKE) -C server build
|
||||
|
||||
build-homepage:
|
||||
$(MAKE) -C ui/homepage build SKIP_SYNC=1
|
||||
$(MAKE) -C ui/homepage build SKIP_SYNC=1
|
||||
|
||||
update-homepage-manifests:
|
||||
$(MAKE) -C ui/homepage sync-dl-index
|
||||
|
||||
build-panel:
|
||||
$(MAKE) -C ui/panel build
|
||||
|
||||
build-dl:
|
||||
$(MAKE) -C ui/dl build
|
||||
build-docs:
|
||||
$(MAKE) -C ui/docs build
|
||||
|
||||
$(MAKE) -C ui/homepage sync-dl-index
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Run targets
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
start: start-openresty start-server start-homepage start-panel start-dl start-docs
|
||||
start: start-openresty start-server start-homepage start-dl start-docs
|
||||
|
||||
start-server:
|
||||
$(MAKE) -C server start
|
||||
@ -129,16 +120,8 @@ start-server:
|
||||
start-homepage:
|
||||
$(MAKE) -C ui/homepage start
|
||||
|
||||
start-panel:
|
||||
$(MAKE) -C ui/panel start
|
||||
|
||||
start-dl:
|
||||
$(MAKE) -C ui/dl start
|
||||
start-docs:
|
||||
$(MAKE) -C ui/docs start
|
||||
|
||||
|
||||
stop: stop-server stop-homepage stop-panel stop-dl stop-docs stop-openresty
|
||||
stop: stop-server stop-homepage stop-openresty
|
||||
|
||||
stop-server:
|
||||
$(MAKE) -C server stop
|
||||
@ -146,15 +129,6 @@ stop-server:
|
||||
stop-homepage:
|
||||
$(MAKE) -C ui/homepage stop
|
||||
|
||||
stop-panel:
|
||||
$(MAKE) -C ui/panel stop
|
||||
|
||||
stop-dl:
|
||||
$(MAKE) -C ui/dl stop
|
||||
stop-docs:
|
||||
$(MAKE) -C ui/docs stop
|
||||
|
||||
|
||||
start-openresty:
|
||||
ifeq ($(OS),Darwin)
|
||||
@brew services start openresty >/dev/null 2>&1 || \
|
||||
|
||||
5
go.mod
5
go.mod
@ -12,8 +12,8 @@ require (
|
||||
github.com/pgvector/pgvector-go v0.3.0
|
||||
github.com/redis/go-redis/v9 v9.12.0
|
||||
github.com/spf13/cobra v1.9.1
|
||||
github.com/tmc/langchaingo v0.1.13
|
||||
github.com/yuin/goldmark v1.7.13
|
||||
golang.org/x/crypto v0.37.0
|
||||
golang.org/x/net v0.39.0
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
gorm.io/gorm v1.25.5
|
||||
@ -29,7 +29,6 @@ require (
|
||||
github.com/cloudflare/circl v1.6.1 // indirect
|
||||
github.com/cyphar/filepath-securejoin v0.4.1 // indirect
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
||||
github.com/dlclark/regexp2 v1.10.0 // indirect
|
||||
github.com/emirpasic/gods v1.18.1 // indirect
|
||||
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
|
||||
github.com/gin-contrib/sse v0.1.0 // indirect
|
||||
@ -55,7 +54,6 @@ require (
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.0.9 // indirect
|
||||
github.com/pjbgf/sha1cd v0.3.2 // indirect
|
||||
github.com/pkoukk/tiktoken-go v0.1.6 // indirect
|
||||
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
|
||||
github.com/skeema/knownhosts v1.3.1 // indirect
|
||||
github.com/spf13/pflag v1.0.6 // indirect
|
||||
@ -63,7 +61,6 @@ require (
|
||||
github.com/ugorji/go/codec v1.2.11 // indirect
|
||||
github.com/xanzy/ssh-agent v0.3.3 // indirect
|
||||
golang.org/x/arch v0.3.0 // indirect
|
||||
golang.org/x/crypto v0.37.0 // indirect
|
||||
golang.org/x/sys v0.32.0 // indirect
|
||||
golang.org/x/text v0.24.0 // indirect
|
||||
google.golang.org/protobuf v1.34.1 // indirect
|
||||
|
||||
9
go.sum
9
go.sum
@ -33,8 +33,6 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
|
||||
github.com/dlclark/regexp2 v1.10.0 h1:+/GIL799phkJqYW+3YbOd8LCcbHzT0Pbo8zl70MHsq0=
|
||||
github.com/dlclark/regexp2 v1.10.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
|
||||
github.com/elazarl/goproxy v1.7.2 h1:Y2o6urb7Eule09PjlhQRGNsqRfPmYI3KKQLFpCAV3+o=
|
||||
github.com/elazarl/goproxy v1.7.2/go.mod h1:82vkLNir0ALaW14Rc399OTTjyNREgmdL2cVoIbS6XaE=
|
||||
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
|
||||
@ -129,8 +127,6 @@ github.com/pjbgf/sha1cd v0.3.2 h1:a9wb0bp1oC2TGwStyn0Umc/IGKQnEgF0vVaZ8QF8eo4=
|
||||
github.com/pjbgf/sha1cd v0.3.2/go.mod h1:zQWigSxVmsHEZow5qaLtPYxpcKMMQpa09ixqBxuCS6A=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkoukk/tiktoken-go v0.1.6 h1:JF0TlJzhTbrI30wCvFuiw6FzP2+/bR+FIxUdgEAcUsw=
|
||||
github.com/pkoukk/tiktoken-go v0.1.6/go.mod h1:9NiV+i9mJKGj1rYOT+njbv+ZwA/zJxYdewGl6qVatpg=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/redis/go-redis/v9 v9.12.0 h1:XlVPGlflh4nxfhsNXPA8Qp6EmEfTo0rp8oaBzPipXnU=
|
||||
@ -161,8 +157,6 @@ github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
|
||||
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/tmc/langchaingo v0.1.13 h1:rcpMWBIi2y3B90XxfE4Ao8dhCQPVDMaNPnN5cGB1CaA=
|
||||
github.com/tmc/langchaingo v0.1.13/go.mod h1:vpQ5NOIhpzxDfTZK9B6tf2GM/MoaHewPWM5KXXGh7hg=
|
||||
github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc h1:9lRDQMhESg+zvGYmW5DyG0UqvY96Bu5QYsTLvCHdrgo=
|
||||
github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GHm1iF1pBvUfxfsH0Wmnc2VbpgvbI9ZWuIRs=
|
||||
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
|
||||
@ -228,7 +222,6 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EV
|
||||
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
|
||||
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
@ -240,5 +233,3 @@ gorm.io/gorm v1.25.5/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8=
|
||||
mellium.im/sasl v0.3.1 h1:wE0LW6g7U83vhvxjC1IY8DnXM+EU095yeo8XClvCdfo=
|
||||
mellium.im/sasl v0.3.1/go.mod h1:xm59PUYpZHhgQ9ZqoJ5QaCqzWMi8IeS49dhp6plPCzw=
|
||||
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
|
||||
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
|
||||
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
|
||||
|
||||
Loading…
Reference in New Issue
Block a user