(taskCtx plugin.SubTaskContext)
| 29 | var _ plugin.SubTaskEntryPoint = ExtractDeployBuild |
| 30 | |
| 31 | func ExtractDeployBuild(taskCtx plugin.SubTaskContext) errors.Error { |
| 32 | rawDataSubTaskArgs, data := CreateRawDataSubTaskArgs(taskCtx, RAW_DEPLOY_BUILD_TABLE) |
| 33 | extractor, err := helper.NewApiExtractor(helper.ApiExtractorArgs{ |
| 34 | RawDataSubTaskArgs: *rawDataSubTaskArgs, |
| 35 | |
| 36 | Extract: func(resData *helper.RawData) ([]interface{}, errors.Error) { |
| 37 | res := &models.ApiBambooDeployBuild{} |
| 38 | err := errors.Convert(json.Unmarshal(resData.Data, res)) |
| 39 | if err != nil { |
| 40 | return nil, err |
| 41 | } |
| 42 | |
| 43 | input := &InputForEnv{} |
| 44 | err = errors.Convert(json.Unmarshal(resData.Input, input)) |
| 45 | if err != nil { |
| 46 | return nil, err |
| 47 | } |
| 48 | |
| 49 | builds := res.Convert(data.Options, input.Name) |
| 50 | var result []interface{} |
| 51 | for _, build := range builds { |
| 52 | result = append(result, build) |
| 53 | } |
| 54 | return result, nil |
| 55 | }, |
| 56 | }) |
| 57 | if err != nil { |
| 58 | return err |
| 59 | } |
| 60 | |
| 61 | return extractor.Execute() |
| 62 | } |
| 63 | |
| 64 | var ExtractDeployBuildMeta = plugin.SubTaskMeta{ |
| 65 | Name: "ExtractDeployBuild", |
nothing calls this directly
no test coverage detected