chore: change template
This commit is contained in:
parent
4259c77974
commit
d95b9c4cb1
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue