From 5599e1a91324e48844b4480b7583a2c55a9695a4 Mon Sep 17 00:00:00 2001 From: gitlawr Date: Thu, 1 Mar 2018 11:20:59 +0800 Subject: [PATCH] update pipeline types Add RunPipelineInput to specify which branch to build Add option for using global github config when enabling pipeline --- apis/management.cattle.io/v3/pipeline_types.go | 5 +++++ apis/management.cattle.io/v3/schema/schema.go | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/apis/management.cattle.io/v3/pipeline_types.go b/apis/management.cattle.io/v3/pipeline_types.go index 911723f5..33faac47 100644 --- a/apis/management.cattle.io/v3/pipeline_types.go +++ b/apis/management.cattle.io/v3/pipeline_types.go @@ -207,7 +207,12 @@ type PipelineExecutionLogSpec struct { Message string `json:"message,omitempty"` } +type RunPipelineInput struct { + Branch string `json:"branch,omitempty"` +} + type AuthAppInput struct { + InheritGlobal bool `json:"inheritGlobal,omitempty"` SourceCodeType string `json:"sourceCodeType,omitempty" norman:"type=string,required"` RedirectURL string `json:"redirectUrl,omitempty" norman:"type=string"` TLS bool `json:"tls,omitempty"` diff --git a/apis/management.cattle.io/v3/schema/schema.go b/apis/management.cattle.io/v3/schema/schema.go index 38950da1..fb3fa128 100644 --- a/apis/management.cattle.io/v3/schema/schema.go +++ b/apis/management.cattle.io/v3/schema/schema.go @@ -393,6 +393,7 @@ func pipelineTypes(schema *types.Schemas) *types.Schemas { AddMapperForType(&Version, v3.PipelineExecutionLog{}). MustImport(&Version, v3.AuthAppInput{}). MustImport(&Version, v3.AuthUserInput{}). + MustImport(&Version, v3.RunPipelineInput{}). MustImportAndCustomize(&Version, v3.SourceCodeCredential{}, func(schema *types.Schema) { schema.ResourceActions = map[string]types.Action{ "refreshrepos": {}, @@ -417,7 +418,9 @@ func pipelineTypes(schema *types.Schemas) *types.Schemas { schema.ResourceActions = map[string]types.Action{ "activate": {}, "deactivate": {}, - "run": {}, + "run": { + Input: "runPipelineInput", + }, } }). MustImportAndCustomize(&Version, v3.PipelineExecution{}, func(schema *types.Schema) {