1
0
mirror of https://github.com/rancher/types.git synced 2025-08-31 21:00:16 +00:00

Merge pull request #264 from gitlawr/pipeline_enhancement

Pipeline - Add option to run specific branch / to reuse global github config
This commit is contained in:
Alena Prokharchyk
2018-03-03 09:33:03 -08:00
committed by GitHub
5 changed files with 41 additions and 1 deletions

View File

@@ -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"`

View File

@@ -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) {

View File

@@ -655,6 +655,10 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
in.(*RoleTemplateList).DeepCopyInto(out.(*RoleTemplateList))
return nil
}, InType: reflect.TypeOf(&RoleTemplateList{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*RunPipelineInput).DeepCopyInto(out.(*RunPipelineInput))
return nil
}, InType: reflect.TypeOf(&RunPipelineInput{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*RunScriptConfig).DeepCopyInto(out.(*RunScriptConfig))
return nil
@@ -5117,6 +5121,22 @@ func (in *RoleTemplateList) DeepCopyObject() runtime.Object {
}
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RunPipelineInput) DeepCopyInto(out *RunPipelineInput) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RunPipelineInput.
func (in *RunPipelineInput) DeepCopy() *RunPipelineInput {
if in == nil {
return nil
}
out := new(RunPipelineInput)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RunScriptConfig) DeepCopyInto(out *RunScriptConfig) {
*out = *in

View File

@@ -6,6 +6,7 @@ const (
AuthAppInputFieldClientSecret = "clientSecret"
AuthAppInputFieldCode = "code"
AuthAppInputFieldHost = "host"
AuthAppInputFieldInheritGlobal = "inheritGlobal"
AuthAppInputFieldRedirectURL = "redirectUrl"
AuthAppInputFieldSourceCodeType = "sourceCodeType"
AuthAppInputFieldTLS = "tls"
@@ -16,6 +17,7 @@ type AuthAppInput struct {
ClientSecret string `json:"clientSecret,omitempty" yaml:"clientSecret,omitempty"`
Code string `json:"code,omitempty" yaml:"code,omitempty"`
Host string `json:"host,omitempty" yaml:"host,omitempty"`
InheritGlobal bool `json:"inheritGlobal,omitempty" yaml:"inheritGlobal,omitempty"`
RedirectURL string `json:"redirectUrl,omitempty" yaml:"redirectUrl,omitempty"`
SourceCodeType string `json:"sourceCodeType,omitempty" yaml:"sourceCodeType,omitempty"`
TLS bool `json:"tls,omitempty" yaml:"tls,omitempty"`

View File

@@ -0,0 +1,10 @@
package client
const (
RunPipelineInputType = "runPipelineInput"
RunPipelineInputFieldBranch = "branch"
)
type RunPipelineInput struct {
Branch string `json:"branch,omitempty" yaml:"branch,omitempty"`
}