diff --git a/template/template_apiservices.go b/template/template_apiservices.go index c1a3fac..4ddd2f8 100644 --- a/template/template_apiservices.go +++ b/template/template_apiservices.go @@ -4,7 +4,7 @@ const templateApiservicesProto = `syntax = "proto3"; package proto.v1; -option go_package = "project/gen;genv1"; +option go_package = "{{.Name}}/gen;genv1"; // @route_group: true diff --git a/template/template_model.go b/template/template_model.go index ea9ae9c..aebe938 100644 --- a/template/template_model.go +++ b/template/template_model.go @@ -4,7 +4,7 @@ const templateProto = `syntax = "proto3"; package proto.v1; -option go_package = "project/gen;genv1"; +option go_package = "{{.Name}}/gen;genv1"; // @table_name: t_file diff --git a/template/template_plugins_config.go b/template/template_plugins_config.go index d8ca31e..3e50e01 100644 --- a/template/template_plugins_config.go +++ b/template/template_plugins_config.go @@ -15,6 +15,7 @@ else endif wire: + go mod tidy cd gen/wire && wire ui: @@ -24,32 +25,36 @@ api: go mod tidy && go build . ./{{.Name}} api +build: gen wire ui api + +run: gen wire ui api + ./{{.Name}} api + all: gen wire ui api + +docker: + podman build -t images.internal/{{.Name}}:latest . + podman push images.internal/{{.Name}}:latest ` -const templateDockerfile = `FROM images.local/golang:latest +const templateDockerfile = `FROM images.internal/devel:latest WORKDIR /app -RUN go install gitter.top/coco/protoc-gen-coco@latest &&\ - go install github.com/golang/protobuf/protoc-gen-go@latest &&\ - go install github.com/bufbuild/buf/cmd/...@latest - COPY . /app -RUN npm install ts-proto -RUN buf generate --exclude-path node_modules -RUN cd webui && npm install && npm run build &&\ - cd .. && go mod tidy && go build . -EXPOSE 38080 -ENTRYPOINT [ "./filesaver", "api" ] +RUN make build + +EXPOSE 38001 + +ENTRYPOINT [ "./{{.Name}}", "api" ] ` const templateDockerCompose = `version: "3" services: server: - image: xuthus5/{{.Name}}:latest + image: images.internal/{{.Name}}:latest container_name: {{.Name}} restart: always volumes: