From 3bbe609404c6e10b2f846eebc77141463a0d079f Mon Sep 17 00:00:00 2001 From: icechen Date: Wed, 5 Jan 2022 16:59:02 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=BB=98=E8=AE=A4api=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E7=9A=84host=E5=92=8Cpath?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 2 +- .../go_handler_template/go_api_production_pipeline.go | 8 ++++++++ go_handler/go_handler_template/go_api_test_pipeline.go | 8 ++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 110ef13..fb9d8c2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ ADD . . RUN go mod tidy RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o main -FROM alpine as drone_plugin +FROM reg.icechen.cn/alpine as drone_plugin WORKDIR /go/src #LABEL maintainer "The Prometheus Authors " COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo diff --git a/go_handler/go_handler_template/go_api_production_pipeline.go b/go_handler/go_handler_template/go_api_production_pipeline.go index a0e51f9..620764c 100644 --- a/go_handler/go_handler_template/go_api_production_pipeline.go +++ b/go_handler/go_handler_template/go_api_production_pipeline.go @@ -43,8 +43,16 @@ steps: - image=reg.icechen.cn/{{ .NameSpace }}/api-{{ .Name }} - imageTag=${DRONE_TAG} - port={{ .Port }} +{{ if .Host }} - host={{ .Host }} +{{ else }} + - host=api.zeus.seamlesser.com +{{ end }} +{{ if .Path }} - path={{ .Path }} +{{ else }} + - path=/{{ .NameSpace }}/{{ .Name }} +{{ end }} volumes: - name: docker diff --git a/go_handler/go_handler_template/go_api_test_pipeline.go b/go_handler/go_handler_template/go_api_test_pipeline.go index 4d3960e..f802338 100644 --- a/go_handler/go_handler_template/go_api_test_pipeline.go +++ b/go_handler/go_handler_template/go_api_test_pipeline.go @@ -43,8 +43,16 @@ steps: - image=reg.icechen.cn/{{ .NameSpace }}/api-{{ .Name }} - imageTag=${DRONE_COMMIT:0:8} - port={{ .Port }} +{{ if .Host }} - host=t{{ .Host }} +{{ else }} + - host=tapi.zeus.seamlesser.com +{{ end }} +{{ if .Path }} - path={{ .Path }} +{{ else }} + - path=/{{ .NameSpace }}/{{ .Name }} +{{ end }} volumes: - name: docker