Skip to content

Commit

Permalink
feat: 蓝鲸网关自动注册 (TencentBlueKing#3265)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ambition9186 authored and Maclon9573 committed Jun 25, 2024
1 parent 0f46256 commit 0ecac16
Show file tree
Hide file tree
Showing 5 changed files with 742 additions and 5 deletions.
8 changes: 8 additions & 0 deletions bcs-services/bcs-bscp/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# init the build information
ifdef HASTAG
GITTAG=${HASTAG}
else
GITTAG=$(shell git describe --always)
endif

# version
PRO_DIR = $(shell pwd)
BUILDTIME = $(shell date +%Y-%m-%dT%T%z)
Expand All @@ -17,6 +24,7 @@ ifeq ("$(VERSION)", "")
export OUTPUT_DIR = ${PRO_DIR}/build/bk-bscp
export LDVersionFLAG = "-X github.com/TencentBlueKing/bk-bcs/bcs-services/bcs-bscp/pkg/version.BUILDTIME=${BUILDTIME} \
-X github.com/TencentBlueKing/bk-bcs/bcs-services/bcs-bscp/pkg/version.GITHASH=${GITHASH} \
-X github.com/TencentBlueKing/bk-bcs/bcs-services/bcs-bscp/pkg/version.GITTAG=${GITTAG} \
-X github.com/TencentBlueKing/bk-bcs/bcs-services/bcs-bscp/pkg/version.DEBUG=${DEBUG}"
else
export OUTPUT_DIR = ${PRO_DIR}/build/bk-bscp-${VERSION}
Expand Down
9 changes: 8 additions & 1 deletion bcs-services/bcs-bscp/cmd/api-server/cmd/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ package cmd

import (
"fmt"
"time"

"github.com/spf13/cobra"

"github.com/TencentBlueKing/bk-bcs/bcs-services/bcs-bscp/pkg/cc"
"github.com/TencentBlueKing/bk-bcs/bcs-services/bcs-bscp/pkg/iam/apigw"
"github.com/TencentBlueKing/bk-bcs/bcs-services/bcs-bscp/pkg/logs"
"github.com/TencentBlueKing/bk-bcs/bcs-services/bcs-bscp/pkg/version"
)

var migrateCmd = &cobra.Command{
Expand All @@ -42,7 +45,11 @@ var migrateInitApigatewayCmd = &cobra.Command{

logs.InitLogger(cc.ApiServer().Log.Logs())

fmt.Println("Need to be implemented")
if err := apigw.ReleaseSwagger(cc.ApiServer(), "zh",
fmt.Sprintf("%s+%s", version.GITTAG, time.Now().Format("20060102150405"))); err != nil {
fmt.Println(err)
return
}
},
}

Expand Down
Loading

0 comments on commit 0ecac16

Please sign in to comment.