Skip to content

Commit

Permalink
更新standard-adapter工具框架版本到0.0.29
Browse files Browse the repository at this point in the history
  • Loading branch information
cnlkl committed Dec 1, 2023
1 parent 6f0217c commit f7e7a46
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion standard-adapter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/TencentBlueKing/ci-repoAnalysis/standard-adapter

go 1.21.0

require github.com/TencentBlueKing/ci-repoAnalysis/analysis-tool-sdk-golang v0.0.28
require github.com/TencentBlueKing/ci-repoAnalysis/analysis-tool-sdk-golang v0.0.29

require (
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
Expand Down
4 changes: 2 additions & 2 deletions standard-adapter/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/TencentBlueKing/ci-repoAnalysis/analysis-tool-sdk-golang v0.0.28 h1:XLPkvJYWpLExlLowXdlY1SAYsiGmqEqb21MfXHF57tg=
github.com/TencentBlueKing/ci-repoAnalysis/analysis-tool-sdk-golang v0.0.28/go.mod h1:gaNOplWKoBM1MBtwllE4y/x1UfXdvlBgLUrECkdnLPE=
github.com/TencentBlueKing/ci-repoAnalysis/analysis-tool-sdk-golang v0.0.29 h1:ElglKqgntisGcj+RKJkNIdT25p9wjMmFB1d+C0O31xk=
github.com/TencentBlueKing/ci-repoAnalysis/analysis-tool-sdk-golang v0.0.29/go.mod h1:gaNOplWKoBM1MBtwllE4y/x1UfXdvlBgLUrECkdnLPE=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
Expand Down
9 changes: 7 additions & 2 deletions standard-adapter/pkg/adapter.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package pkg

import (
"context"
"encoding/json"
"github.com/TencentBlueKing/ci-repoAnalysis/analysis-tool-sdk-golang/api"
"github.com/TencentBlueKing/ci-repoAnalysis/analysis-tool-sdk-golang/object"
Expand All @@ -16,7 +17,11 @@ type StandardAdapterExecutor struct {
}

// Execute 执行扫描
func (e StandardAdapterExecutor) Execute(_ *object.ToolConfig, file *os.File) (*object.ToolOutput, error) {
func (e StandardAdapterExecutor) Execute(
ctx context.Context,
_ *object.ToolConfig,
file *os.File,
) (*object.ToolOutput, error) {
// 将toolInput写入/bkrepo/workspace/input.json
toolInput := api.GetClient(object.GetArgs()).ToolInput
newToolInput := &object.ToolInput{
Expand All @@ -41,7 +46,7 @@ func (e StandardAdapterExecutor) Execute(_ *object.ToolConfig, file *os.File) (*
args = append(args, splitCmd[1:]...)
}
args = append(args, "--input", toolInputFile, "--output", toolOutputFile)
err := util.ExecAndLog(cmd, args, e.WorkDir)
err := util.ExecAndLog(ctx, cmd, args, e.WorkDir)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit f7e7a46

Please sign in to comment.