From 8a218d07cba7125219de7480a446a72e4abcf76e Mon Sep 17 00:00:00 2001 From: icechen Date: Tue, 4 Jan 2022 19:37:59 +0800 Subject: [PATCH] fix: add host --- config_handler/config_handler.go | 4 ++++ go_handler/go_handler_template/go_api_production_pipeline.go | 2 ++ go_handler/go_handler_template/go_api_test_pipeline.go | 2 ++ 3 files changed, 8 insertions(+) diff --git a/config_handler/config_handler.go b/config_handler/config_handler.go index 3a3bce2..98ac3ce 100644 --- a/config_handler/config_handler.go +++ b/config_handler/config_handler.go @@ -76,6 +76,10 @@ func (p *plugin) Find(ctx context.Context, req *config.Request) (*drone.Config, return nil, err } + if len(modifiedApiList) == 0 && len(modifiedServiceList) == 0 { + // 返回 nil 按照 204 处理 + return nil, nil + } retData := destinationApi + "\n\n" + destinationService n := strings.LastIndex(retData, "---") if n > 0 { 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 3059975..e4187f4 100644 --- a/go_handler/go_handler_template/go_api_production_pipeline.go +++ b/go_handler/go_handler_template/go_api_production_pipeline.go @@ -39,4 +39,6 @@ steps: - image=reg.icechen.cn/{{ .NameSpace }}/api-{{ .Name }} - imageTag=${DRONE_TAG} - port={{ .Port }} + - host=t{{ .Host }} + - path={{ .Path }} ` 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 ff024db..b1e8f41 100644 --- a/go_handler/go_handler_template/go_api_test_pipeline.go +++ b/go_handler/go_handler_template/go_api_test_pipeline.go @@ -39,4 +39,6 @@ steps: - image=reg.icechen.cn/{{ .NameSpace }}/api-{{ .Name }} - imageTag=${DRONE_COMMIT:0:8} - port={{ .Port }} + - host=t{{ .Host }} + - path={{ .Path }} `