pipeline crd

Signed-off-by: runzexia <runzexia@yunify.com>
This commit is contained in:
runzexia
2020-03-25 10:58:39 +08:00
parent 7a00f9e3e4
commit 23c8d71a5a
28 changed files with 3031 additions and 612 deletions

View File

@@ -30,60 +30,78 @@ import (
func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition {
return map[string]common.OpenAPIDefinition{
"k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup": schema_pkg_apis_meta_v1_APIGroup(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.APIGroupList": schema_pkg_apis_meta_v1_APIGroupList(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.APIResource": schema_pkg_apis_meta_v1_APIResource(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.APIResourceList": schema_pkg_apis_meta_v1_APIResourceList(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.APIVersions": schema_pkg_apis_meta_v1_APIVersions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.CreateOptions": schema_pkg_apis_meta_v1_CreateOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.DeleteOptions": schema_pkg_apis_meta_v1_DeleteOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Duration": schema_pkg_apis_meta_v1_Duration(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.ExportOptions": schema_pkg_apis_meta_v1_ExportOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.FieldsV1": schema_pkg_apis_meta_v1_FieldsV1(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GetOptions": schema_pkg_apis_meta_v1_GetOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GroupKind": schema_pkg_apis_meta_v1_GroupKind(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GroupResource": schema_pkg_apis_meta_v1_GroupResource(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersion": schema_pkg_apis_meta_v1_GroupVersion(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery": schema_pkg_apis_meta_v1_GroupVersionForDiscovery(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionKind": schema_pkg_apis_meta_v1_GroupVersionKind(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionResource": schema_pkg_apis_meta_v1_GroupVersionResource(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.InternalEvent": schema_pkg_apis_meta_v1_InternalEvent(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector": schema_pkg_apis_meta_v1_LabelSelector(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement": schema_pkg_apis_meta_v1_LabelSelectorRequirement(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.List": schema_pkg_apis_meta_v1_List(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta": schema_pkg_apis_meta_v1_ListMeta(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.ListOptions": schema_pkg_apis_meta_v1_ListOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.ManagedFieldsEntry": schema_pkg_apis_meta_v1_ManagedFieldsEntry(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime": schema_pkg_apis_meta_v1_MicroTime(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta": schema_pkg_apis_meta_v1_ObjectMeta(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference": schema_pkg_apis_meta_v1_OwnerReference(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadata": schema_pkg_apis_meta_v1_PartialObjectMetadata(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadataList": schema_pkg_apis_meta_v1_PartialObjectMetadataList(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Patch": schema_pkg_apis_meta_v1_Patch(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.PatchOptions": schema_pkg_apis_meta_v1_PatchOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Preconditions": schema_pkg_apis_meta_v1_Preconditions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.RootPaths": schema_pkg_apis_meta_v1_RootPaths(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR": schema_pkg_apis_meta_v1_ServerAddressByClientCIDR(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Status": schema_pkg_apis_meta_v1_Status(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause": schema_pkg_apis_meta_v1_StatusCause(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails": schema_pkg_apis_meta_v1_StatusDetails(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Table": schema_pkg_apis_meta_v1_Table(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.TableColumnDefinition": schema_pkg_apis_meta_v1_TableColumnDefinition(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.TableOptions": schema_pkg_apis_meta_v1_TableOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.TableRow": schema_pkg_apis_meta_v1_TableRow(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.TableRowCondition": schema_pkg_apis_meta_v1_TableRowCondition(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Time": schema_pkg_apis_meta_v1_Time(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Timestamp": schema_pkg_apis_meta_v1_Timestamp(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta": schema_pkg_apis_meta_v1_TypeMeta(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.UpdateOptions": schema_pkg_apis_meta_v1_UpdateOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.WatchEvent": schema_pkg_apis_meta_v1_WatchEvent(ref),
"k8s.io/apimachinery/pkg/runtime.RawExtension": schema_k8sio_apimachinery_pkg_runtime_RawExtension(ref),
"k8s.io/apimachinery/pkg/runtime.TypeMeta": schema_k8sio_apimachinery_pkg_runtime_TypeMeta(ref),
"k8s.io/apimachinery/pkg/runtime.Unknown": schema_k8sio_apimachinery_pkg_runtime_Unknown(ref),
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.DevOpsProject": schema_pkg_apis_devops_v1alpha3_DevOpsProject(ref),
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.DevOpsProjectList": schema_pkg_apis_devops_v1alpha3_DevOpsProjectList(ref),
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.DevOpsProjectSpec": schema_pkg_apis_devops_v1alpha3_DevOpsProjectSpec(ref),
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.DevOpsProjectStatus": schema_pkg_apis_devops_v1alpha3_DevOpsProjectStatus(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup": schema_pkg_apis_meta_v1_APIGroup(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.APIGroupList": schema_pkg_apis_meta_v1_APIGroupList(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.APIResource": schema_pkg_apis_meta_v1_APIResource(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.APIResourceList": schema_pkg_apis_meta_v1_APIResourceList(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.APIVersions": schema_pkg_apis_meta_v1_APIVersions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.CreateOptions": schema_pkg_apis_meta_v1_CreateOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.DeleteOptions": schema_pkg_apis_meta_v1_DeleteOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Duration": schema_pkg_apis_meta_v1_Duration(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.ExportOptions": schema_pkg_apis_meta_v1_ExportOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.FieldsV1": schema_pkg_apis_meta_v1_FieldsV1(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GetOptions": schema_pkg_apis_meta_v1_GetOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GroupKind": schema_pkg_apis_meta_v1_GroupKind(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GroupResource": schema_pkg_apis_meta_v1_GroupResource(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersion": schema_pkg_apis_meta_v1_GroupVersion(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery": schema_pkg_apis_meta_v1_GroupVersionForDiscovery(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionKind": schema_pkg_apis_meta_v1_GroupVersionKind(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionResource": schema_pkg_apis_meta_v1_GroupVersionResource(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.InternalEvent": schema_pkg_apis_meta_v1_InternalEvent(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector": schema_pkg_apis_meta_v1_LabelSelector(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement": schema_pkg_apis_meta_v1_LabelSelectorRequirement(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.List": schema_pkg_apis_meta_v1_List(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta": schema_pkg_apis_meta_v1_ListMeta(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.ListOptions": schema_pkg_apis_meta_v1_ListOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.ManagedFieldsEntry": schema_pkg_apis_meta_v1_ManagedFieldsEntry(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime": schema_pkg_apis_meta_v1_MicroTime(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta": schema_pkg_apis_meta_v1_ObjectMeta(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference": schema_pkg_apis_meta_v1_OwnerReference(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadata": schema_pkg_apis_meta_v1_PartialObjectMetadata(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadataList": schema_pkg_apis_meta_v1_PartialObjectMetadataList(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Patch": schema_pkg_apis_meta_v1_Patch(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.PatchOptions": schema_pkg_apis_meta_v1_PatchOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Preconditions": schema_pkg_apis_meta_v1_Preconditions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.RootPaths": schema_pkg_apis_meta_v1_RootPaths(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR": schema_pkg_apis_meta_v1_ServerAddressByClientCIDR(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Status": schema_pkg_apis_meta_v1_Status(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause": schema_pkg_apis_meta_v1_StatusCause(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails": schema_pkg_apis_meta_v1_StatusDetails(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Table": schema_pkg_apis_meta_v1_Table(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.TableColumnDefinition": schema_pkg_apis_meta_v1_TableColumnDefinition(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.TableOptions": schema_pkg_apis_meta_v1_TableOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.TableRow": schema_pkg_apis_meta_v1_TableRow(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.TableRowCondition": schema_pkg_apis_meta_v1_TableRowCondition(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Time": schema_pkg_apis_meta_v1_Time(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Timestamp": schema_pkg_apis_meta_v1_Timestamp(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta": schema_pkg_apis_meta_v1_TypeMeta(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.UpdateOptions": schema_pkg_apis_meta_v1_UpdateOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.WatchEvent": schema_pkg_apis_meta_v1_WatchEvent(ref),
"k8s.io/apimachinery/pkg/runtime.RawExtension": schema_k8sio_apimachinery_pkg_runtime_RawExtension(ref),
"k8s.io/apimachinery/pkg/runtime.TypeMeta": schema_k8sio_apimachinery_pkg_runtime_TypeMeta(ref),
"k8s.io/apimachinery/pkg/runtime.Unknown": schema_k8sio_apimachinery_pkg_runtime_Unknown(ref),
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.BitbucketServerSource": schema_pkg_apis_devops_v1alpha3_BitbucketServerSource(ref),
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.DevOpsProject": schema_pkg_apis_devops_v1alpha3_DevOpsProject(ref),
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.DevOpsProjectList": schema_pkg_apis_devops_v1alpha3_DevOpsProjectList(ref),
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.DevOpsProjectSpec": schema_pkg_apis_devops_v1alpha3_DevOpsProjectSpec(ref),
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.DevOpsProjectStatus": schema_pkg_apis_devops_v1alpha3_DevOpsProjectStatus(ref),
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.DiscarderProperty": schema_pkg_apis_devops_v1alpha3_DiscarderProperty(ref),
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.DiscoverPRFromForks": schema_pkg_apis_devops_v1alpha3_DiscoverPRFromForks(ref),
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.GitCloneOption": schema_pkg_apis_devops_v1alpha3_GitCloneOption(ref),
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.GitSource": schema_pkg_apis_devops_v1alpha3_GitSource(ref),
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.GithubSource": schema_pkg_apis_devops_v1alpha3_GithubSource(ref),
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.MultiBranchJobTrigger": schema_pkg_apis_devops_v1alpha3_MultiBranchJobTrigger(ref),
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.MultiBranchPipeline": schema_pkg_apis_devops_v1alpha3_MultiBranchPipeline(ref),
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.NoScmPipeline": schema_pkg_apis_devops_v1alpha3_NoScmPipeline(ref),
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.Parameter": schema_pkg_apis_devops_v1alpha3_Parameter(ref),
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.Pipeline": schema_pkg_apis_devops_v1alpha3_Pipeline(ref),
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.PipelineList": schema_pkg_apis_devops_v1alpha3_PipelineList(ref),
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.PipelineSpec": schema_pkg_apis_devops_v1alpha3_PipelineSpec(ref),
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.PipelineStatus": schema_pkg_apis_devops_v1alpha3_PipelineStatus(ref),
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.RemoteTrigger": schema_pkg_apis_devops_v1alpha3_RemoteTrigger(ref),
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.SingleSvnSource": schema_pkg_apis_devops_v1alpha3_SingleSvnSource(ref),
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.SvnSource": schema_pkg_apis_devops_v1alpha3_SvnSource(ref),
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.TimerTrigger": schema_pkg_apis_devops_v1alpha3_TimerTrigger(ref),
}
}
@@ -2245,6 +2263,78 @@ func schema_k8sio_apimachinery_pkg_runtime_Unknown(ref common.ReferenceCallback)
}
}
func schema_pkg_apis_devops_v1alpha3_BitbucketServerSource(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"scm_id": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"owner": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"repo": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"credential_id": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"api_uri": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"discover_branches": {
SchemaProps: spec.SchemaProps{
Type: []string{"integer"},
Format: "int32",
},
},
"discover_pr_from_origin": {
SchemaProps: spec.SchemaProps{
Type: []string{"integer"},
Format: "int32",
},
},
"discover_pr_from_forks": {
SchemaProps: spec.SchemaProps{
Ref: ref("kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.DiscoverPRFromForks"),
},
},
"git_clone_option": {
SchemaProps: spec.SchemaProps{
Ref: ref("kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.GitCloneOption"),
},
},
"regex_filter": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
},
},
},
Dependencies: []string{
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.DiscoverPRFromForks", "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.GitCloneOption"},
}
}
func schema_pkg_apis_devops_v1alpha3_DevOpsProject(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
@@ -2366,3 +2456,659 @@ func schema_pkg_apis_devops_v1alpha3_DevOpsProjectStatus(ref common.ReferenceCal
},
}
}
func schema_pkg_apis_devops_v1alpha3_DiscarderProperty(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"days_to_keep": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"num_to_keep": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
},
},
},
}
}
func schema_pkg_apis_devops_v1alpha3_DiscoverPRFromForks(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"strategy": {
SchemaProps: spec.SchemaProps{
Type: []string{"integer"},
Format: "int32",
},
},
"trust": {
SchemaProps: spec.SchemaProps{
Type: []string{"integer"},
Format: "int32",
},
},
},
},
},
}
}
func schema_pkg_apis_devops_v1alpha3_GitCloneOption(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"shallow": {
SchemaProps: spec.SchemaProps{
Type: []string{"boolean"},
Format: "",
},
},
"timeout": {
SchemaProps: spec.SchemaProps{
Type: []string{"integer"},
Format: "int32",
},
},
"depth": {
SchemaProps: spec.SchemaProps{
Type: []string{"integer"},
Format: "int32",
},
},
},
},
},
}
}
func schema_pkg_apis_devops_v1alpha3_GitSource(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"scm_id": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"url": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"credential_id": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"discover_branches": {
SchemaProps: spec.SchemaProps{
Type: []string{"boolean"},
Format: "",
},
},
"git_clone_option": {
SchemaProps: spec.SchemaProps{
Ref: ref("kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.GitCloneOption"),
},
},
"regex_filter": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
},
},
},
Dependencies: []string{
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.GitCloneOption"},
}
}
func schema_pkg_apis_devops_v1alpha3_GithubSource(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"scm_id": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"owner": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"repo": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"credential_id": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"api_uri": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"discover_branches": {
SchemaProps: spec.SchemaProps{
Type: []string{"integer"},
Format: "int32",
},
},
"discover_pr_from_origin": {
SchemaProps: spec.SchemaProps{
Type: []string{"integer"},
Format: "int32",
},
},
"discover_pr_from_forks": {
SchemaProps: spec.SchemaProps{
Ref: ref("kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.DiscoverPRFromForks"),
},
},
"git_clone_option": {
SchemaProps: spec.SchemaProps{
Ref: ref("kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.GitCloneOption"),
},
},
"regex_filter": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
},
},
},
Dependencies: []string{
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.DiscoverPRFromForks", "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.GitCloneOption"},
}
}
func schema_pkg_apis_devops_v1alpha3_MultiBranchJobTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"create_action_job_to_trigger": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"delete_action_job_to_trigger": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
},
},
},
}
}
func schema_pkg_apis_devops_v1alpha3_MultiBranchPipeline(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"name": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"descriptio": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"discarder": {
SchemaProps: spec.SchemaProps{
Ref: ref("kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.DiscarderProperty"),
},
},
"timer_trigger": {
SchemaProps: spec.SchemaProps{
Ref: ref("kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.TimerTrigger"),
},
},
"source_type": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"git_source": {
SchemaProps: spec.SchemaProps{
Ref: ref("kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.GitSource"),
},
},
"github_source": {
SchemaProps: spec.SchemaProps{
Ref: ref("kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.GithubSource"),
},
},
"svn_source": {
SchemaProps: spec.SchemaProps{
Ref: ref("kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.SvnSource"),
},
},
"single_svn_source": {
SchemaProps: spec.SchemaProps{
Ref: ref("kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.SingleSvnSource"),
},
},
"bitbucket_server_source": {
SchemaProps: spec.SchemaProps{
Ref: ref("kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.BitbucketServerSource"),
},
},
"script_path": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"multibranch_job_trigger": {
SchemaProps: spec.SchemaProps{
Ref: ref("kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.MultiBranchJobTrigger"),
},
},
},
Required: []string{"name", "source_type", "script_path"},
},
},
Dependencies: []string{
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.BitbucketServerSource", "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.DiscarderProperty", "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.GitSource", "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.GithubSource", "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.MultiBranchJobTrigger", "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.SingleSvnSource", "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.SvnSource", "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.TimerTrigger"},
}
}
func schema_pkg_apis_devops_v1alpha3_NoScmPipeline(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"name": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"descriptio": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"discarder": {
SchemaProps: spec.SchemaProps{
Ref: ref("kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.DiscarderProperty"),
},
},
"parameters": {
SchemaProps: spec.SchemaProps{
Type: []string{"array"},
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Ref: ref("kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.Parameter"),
},
},
},
},
},
"disable_concurrent": {
SchemaProps: spec.SchemaProps{
Type: []string{"boolean"},
Format: "",
},
},
"timer_trigger": {
SchemaProps: spec.SchemaProps{
Ref: ref("kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.TimerTrigger"),
},
},
"remote_trigger": {
SchemaProps: spec.SchemaProps{
Ref: ref("kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.RemoteTrigger"),
},
},
"jenkinsfile": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
},
Required: []string{"name"},
},
},
Dependencies: []string{
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.DiscarderProperty", "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.Parameter", "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.RemoteTrigger", "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.TimerTrigger"},
}
}
func schema_pkg_apis_devops_v1alpha3_Parameter(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"name": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"default_value": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"type": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"description": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
},
Required: []string{"name", "type"},
},
},
}
}
func schema_pkg_apis_devops_v1alpha3_Pipeline(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "Pipeline is the Schema for the pipelines API",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"kind": {
SchemaProps: spec.SchemaProps{
Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
Type: []string{"string"},
Format: "",
},
},
"apiVersion": {
SchemaProps: spec.SchemaProps{
Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
Type: []string{"string"},
Format: "",
},
},
"metadata": {
SchemaProps: spec.SchemaProps{
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"),
},
},
"spec": {
SchemaProps: spec.SchemaProps{
Ref: ref("kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.PipelineSpec"),
},
},
"status": {
SchemaProps: spec.SchemaProps{
Ref: ref("kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.PipelineStatus"),
},
},
},
},
},
Dependencies: []string{
"k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.PipelineSpec", "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.PipelineStatus"},
}
}
func schema_pkg_apis_devops_v1alpha3_PipelineList(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "PipelineList contains a list of Pipeline",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"kind": {
SchemaProps: spec.SchemaProps{
Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
Type: []string{"string"},
Format: "",
},
},
"apiVersion": {
SchemaProps: spec.SchemaProps{
Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
Type: []string{"string"},
Format: "",
},
},
"metadata": {
SchemaProps: spec.SchemaProps{
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"),
},
},
"items": {
SchemaProps: spec.SchemaProps{
Type: []string{"array"},
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{
Ref: ref("kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.Pipeline"),
},
},
},
},
},
},
Required: []string{"items"},
},
},
Dependencies: []string{
"k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.Pipeline"},
}
}
func schema_pkg_apis_devops_v1alpha3_PipelineSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "PipelineSpec defines the desired state of Pipeline",
Type: []string{"object"},
Properties: map[string]spec.Schema{
"type": {
SchemaProps: spec.SchemaProps{
Description: "INSERT ADDITIONAL SPEC FIELDS - desired state of cluster Important: Run \"make\" to regenerate code after modifying this file",
Type: []string{"string"},
Format: "",
},
},
"pipeline": {
SchemaProps: spec.SchemaProps{
Ref: ref("kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.NoScmPipeline"),
},
},
"multi_branch_pipeline": {
SchemaProps: spec.SchemaProps{
Ref: ref("kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.MultiBranchPipeline"),
},
},
},
Required: []string{"type"},
},
},
Dependencies: []string{
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.MultiBranchPipeline", "kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3.NoScmPipeline"},
}
}
func schema_pkg_apis_devops_v1alpha3_PipelineStatus(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Description: "PipelineStatus defines the observed state of Pipeline",
Type: []string{"object"},
},
},
}
}
func schema_pkg_apis_devops_v1alpha3_RemoteTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"token": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
},
},
},
}
}
func schema_pkg_apis_devops_v1alpha3_SingleSvnSource(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"scm_id": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"remote": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"credential_id": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
},
},
},
}
}
func schema_pkg_apis_devops_v1alpha3_SvnSource(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"scm_id": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"remote": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"credential_id": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"includes": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
"excludes": {
SchemaProps: spec.SchemaProps{
Type: []string{"string"},
Format: "",
},
},
},
},
},
}
}
func schema_pkg_apis_devops_v1alpha3_TimerTrigger(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
Type: []string{"object"},
Properties: map[string]spec.Schema{
"cron": {
SchemaProps: spec.SchemaProps{
Description: "user in no scm job",
Type: []string{"string"},
Format: "",
},
},
"interval": {
SchemaProps: spec.SchemaProps{
Description: "use in multi-branch job",
Type: []string{"string"},
Format: "",
},
},
},
},
},
}
}

View File

@@ -0,0 +1,192 @@
/*
Copyright 2019 The KubeSphere authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha3
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
const PipelineFinalizerName = "pipeline.finalizers.kubesphere.io"
const (
ResourceKindPipeline = "Pipeline"
ResourceSingularPipeline = "pipeline"
ResourcePluralPipeline = "pipelines"
)
// PipelineSpec defines the desired state of Pipeline
type PipelineSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file
Type string `json:"type" description:"type of devops pipeline, in scm or no scm"`
Pipeline *NoScmPipeline `json:"pipeline,omitempty" description:"no scm pipeline structs"`
MultiBranchPipeline *MultiBranchPipeline `json:"multi_branch_pipeline,omitempty" description:"in scm pipeline structs"`
}
// PipelineStatus defines the observed state of Pipeline
type PipelineStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "make" to regenerate code after modifying this file
}
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// Pipeline is the Schema for the pipelines API
// +k8s:openapi-gen=true
type Pipeline struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec PipelineSpec `json:"spec,omitempty"`
Status PipelineStatus `json:"status,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// PipelineList contains a list of Pipeline
type PipelineList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Pipeline `json:"items"`
}
func init() {
SchemeBuilder.Register(&Pipeline{}, &PipelineList{})
}
const (
NoScmPipelineType = "pipeline"
MultiBranchPipelineType = "multi-branch-pipeline"
)
type NoScmPipeline struct {
Name string `json:"name" description:"name of pipeline"`
Description string `json:"descriptio,omitempty" description:"description of pipeline"`
Discarder *DiscarderProperty `json:"discarder,omitempty" description:"Discarder of pipeline, managing when to drop a pipeline"`
Parameters []Parameter `json:"parameters,omitempty" description:"Parameters define of pipeline,user could pass param when run pipeline"`
DisableConcurrent bool `json:"disable_concurrent,omitempty" mapstructure:"disable_concurrent" description:"Whether to prohibit the pipeline from running in parallel"`
TimerTrigger *TimerTrigger `json:"timer_trigger,omitempty" mapstructure:"timer_trigger" description:"Timer to trigger pipeline run"`
RemoteTrigger *RemoteTrigger `json:"remote_trigger,omitempty" mapstructure:"remote_trigger" description:"Remote api define to trigger pipeline run"`
Jenkinsfile string `json:"jenkinsfile,omitempty" description:"Jenkinsfile's content'"`
}
type MultiBranchPipeline struct {
Name string `json:"name" description:"name of pipeline"`
Description string `json:"descriptio,omitempty" description:"description of pipeline"`
Discarder *DiscarderProperty `json:"discarder,omitempty" description:"Discarder of pipeline, managing when to drop a pipeline"`
TimerTrigger *TimerTrigger `json:"timer_trigger,omitempty" mapstructure:"timer_trigger" description:"Timer to trigger pipeline run"`
SourceType string `json:"source_type" description:"type of scm, such as github/git/svn"`
GitSource *GitSource `json:"git_source,omitempty" description:"git scm define"`
GitHubSource *GithubSource `json:"github_source,omitempty" description:"github scm define"`
SvnSource *SvnSource `json:"svn_source,omitempty" description:"multi branch svn scm define"`
SingleSvnSource *SingleSvnSource `json:"single_svn_source,omitempty" description:"single branch svn scm define"`
BitbucketServerSource *BitbucketServerSource `json:"bitbucket_server_source,omitempty" description:"bitbucket server scm defile"`
ScriptPath string `json:"script_path" mapstructure:"script_path" description:"script path in scm"`
MultiBranchJobTrigger *MultiBranchJobTrigger `json:"multibranch_job_trigger,omitempty" mapstructure:"multibranch_job_trigger" description:"Pipeline tasks that need to be triggered when branch creation/deletion"`
}
type GitSource struct {
ScmId string `json:"scm_id,omitempty" description:"uid of scm"`
Url string `json:"url,omitempty" mapstructure:"url" description:"url of git source"`
CredentialId string `json:"credential_id,omitempty" mapstructure:"credential_id" description:"credential id to access git source"`
DiscoverBranches bool `json:"discover_branches,omitempty" mapstructure:"discover_branches" description:"Whether to discover a branch"`
CloneOption *GitCloneOption `json:"git_clone_option,omitempty" mapstructure:"git_clone_option" description:"advavced git clone options"`
RegexFilter string `json:"regex_filter,omitempty" mapstructure:"regex_filter" description:"Regex used to match the name of the branch that needs to be run"`
}
type GithubSource struct {
ScmId string `json:"scm_id,omitempty" description:"uid of scm"`
Owner string `json:"owner,omitempty" mapstructure:"owner" description:"owner of github repo"`
Repo string `json:"repo,omitempty" mapstructure:"repo" description:"repo name of github repo"`
CredentialId string `json:"credential_id,omitempty" mapstructure:"credential_id" description:"credential id to access github source"`
ApiUri string `json:"api_uri,omitempty" mapstructure:"api_uri" description:"The api url can specify the location of the github apiserver.For private cloud configuration"`
DiscoverBranches int `json:"discover_branches,omitempty" mapstructure:"discover_branches" description:"Discover branch configuration"`
DiscoverPRFromOrigin int `json:"discover_pr_from_origin,omitempty" mapstructure:"discover_pr_from_origin" description:"Discover origin PR configuration"`
DiscoverPRFromForks *DiscoverPRFromForks `json:"discover_pr_from_forks,omitempty" mapstructure:"discover_pr_from_forks" description:"Discover fork PR configuration"`
CloneOption *GitCloneOption `json:"git_clone_option,omitempty" mapstructure:"git_clone_option" description:"advavced git clone options"`
RegexFilter string `json:"regex_filter,omitempty" mapstructure:"regex_filter" description:"Regex used to match the name of the branch that needs to be run"`
}
type MultiBranchJobTrigger struct {
CreateActionJobsToTrigger string `json:"create_action_job_to_trigger,omitempty" description:"pipeline name to trigger"`
DeleteActionJobsToTrigger string `json:"delete_action_job_to_trigger,omitempty" description:"pipeline name to trigger"`
}
type BitbucketServerSource struct {
ScmId string `json:"scm_id,omitempty" description:"uid of scm"`
Owner string `json:"owner,omitempty" mapstructure:"owner" description:"owner of github repo"`
Repo string `json:"repo,omitempty" mapstructure:"repo" description:"repo name of github repo"`
CredentialId string `json:"credential_id,omitempty" mapstructure:"credential_id" description:"credential id to access github source"`
ApiUri string `json:"api_uri,omitempty" mapstructure:"api_uri" description:"The api url can specify the location of the github apiserver.For private cloud configuration"`
DiscoverBranches int `json:"discover_branches,omitempty" mapstructure:"discover_branches" description:"Discover branch configuration"`
DiscoverPRFromOrigin int `json:"discover_pr_from_origin,omitempty" mapstructure:"discover_pr_from_origin" description:"Discover origin PR configuration"`
DiscoverPRFromForks *DiscoverPRFromForks `json:"discover_pr_from_forks,omitempty" mapstructure:"discover_pr_from_forks" description:"Discover fork PR configuration"`
CloneOption *GitCloneOption `json:"git_clone_option,omitempty" mapstructure:"git_clone_option" description:"advavced git clone options"`
RegexFilter string `json:"regex_filter,omitempty" mapstructure:"regex_filter" description:"Regex used to match the name of the branch that needs to be run"`
}
type GitCloneOption struct {
Shallow bool `json:"shallow,omitempty" mapstructure:"shallow" description:"Whether to use git shallow clone"`
Timeout int `json:"timeout,omitempty" mapstructure:"timeout" description:"git clone timeout mins"`
Depth int `json:"depth,omitempty" mapstructure:"depth" description:"git clone depth"`
}
type SvnSource struct {
ScmId string `json:"scm_id,omitempty" description:"uid of scm"`
Remote string `json:"remote,omitempty" description:"remote address url"`
CredentialId string `json:"credential_id,omitempty" mapstructure:"credential_id" description:"credential id to access svn source"`
Includes string `json:"includes,omitempty" description:"branches to run pipeline"`
Excludes string `json:"excludes,omitempty" description:"branches do not run pipeline"`
}
type SingleSvnSource struct {
ScmId string `json:"scm_id,omitempty" description:"uid of scm"`
Remote string `json:"remote,omitempty" description:"remote address url"`
CredentialId string `json:"credential_id,omitempty" mapstructure:"credential_id" description:"credential id to access svn source"`
}
type DiscoverPRFromForks struct {
Strategy int `json:"strategy,omitempty" mapstructure:"strategy" description:"github discover strategy"`
Trust int `json:"trust,omitempty" mapstructure:"trust" description:"trust user type"`
}
type DiscarderProperty struct {
DaysToKeep string `json:"days_to_keep,omitempty" mapstructure:"days_to_keep" description:"days to keep pipeline"`
NumToKeep string `json:"num_to_keep,omitempty" mapstructure:"num_to_keep" description:"nums to keep pipeline"`
}
type Parameter struct {
Name string `json:"name" description:"name of param"`
DefaultValue string `json:"default_value,omitempty" mapstructure:"default_value" description:"default value of param"`
Type string `json:"type" description:"type of param"`
Description string `json:"description,omitempty" description:"description of pipeline"`
}
type TimerTrigger struct {
// user in no scm job
Cron string `json:"cron,omitempty" description:"jenkins cron script"`
// use in multi-branch job
Interval string `json:"interval,omitempty" description:"interval ms"`
}
type RemoteTrigger struct {
Token string `json:"token,omitempty" description:"remote trigger token"`
}

View File

@@ -0,0 +1,58 @@
/*
Copyright 2019 The KubeSphere authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha3
import (
"testing"
"github.com/onsi/gomega"
"golang.org/x/net/context"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
)
func TestStoragePipeline(t *testing.T) {
key := types.NamespacedName{
Name: "foo",
Namespace: "default",
}
created := &Pipeline{
ObjectMeta: metav1.ObjectMeta{
Name: "foo",
Namespace: "default",
}}
g := gomega.NewGomegaWithT(t)
// Test Create
fetched := &Pipeline{}
g.Expect(c.Create(context.TODO(), created)).To(gomega.Succeed())
g.Expect(c.Get(context.TODO(), key, fetched)).To(gomega.Succeed())
g.Expect(fetched).To(gomega.Equal(created))
// Test Updating the Labels
updated := fetched.DeepCopy()
updated.Labels = map[string]string{"hello": "world"}
g.Expect(c.Update(context.TODO(), updated)).To(gomega.Succeed())
g.Expect(c.Get(context.TODO(), key, fetched)).To(gomega.Succeed())
g.Expect(fetched).To(gomega.Equal(updated))
// Test Delete
g.Expect(c.Delete(context.TODO(), fetched)).To(gomega.Succeed())
g.Expect(c.Get(context.TODO(), key, fetched)).ToNot(gomega.Succeed())
}

View File

@@ -24,6 +24,31 @@ import (
runtime "k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *BitbucketServerSource) DeepCopyInto(out *BitbucketServerSource) {
*out = *in
if in.DiscoverPRFromForks != nil {
in, out := &in.DiscoverPRFromForks, &out.DiscoverPRFromForks
*out = new(DiscoverPRFromForks)
**out = **in
}
if in.CloneOption != nil {
in, out := &in.CloneOption, &out.CloneOption
*out = new(GitCloneOption)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BitbucketServerSource.
func (in *BitbucketServerSource) DeepCopy() *BitbucketServerSource {
if in == nil {
return nil
}
out := new(BitbucketServerSource)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DevOpsProject) DeepCopyInto(out *DevOpsProject) {
*out = *in
@@ -112,3 +137,372 @@ func (in *DevOpsProjectStatus) DeepCopy() *DevOpsProjectStatus {
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DiscarderProperty) DeepCopyInto(out *DiscarderProperty) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiscarderProperty.
func (in *DiscarderProperty) DeepCopy() *DiscarderProperty {
if in == nil {
return nil
}
out := new(DiscarderProperty)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DiscoverPRFromForks) DeepCopyInto(out *DiscoverPRFromForks) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiscoverPRFromForks.
func (in *DiscoverPRFromForks) DeepCopy() *DiscoverPRFromForks {
if in == nil {
return nil
}
out := new(DiscoverPRFromForks)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GitCloneOption) DeepCopyInto(out *GitCloneOption) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitCloneOption.
func (in *GitCloneOption) DeepCopy() *GitCloneOption {
if in == nil {
return nil
}
out := new(GitCloneOption)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GitSource) DeepCopyInto(out *GitSource) {
*out = *in
if in.CloneOption != nil {
in, out := &in.CloneOption, &out.CloneOption
*out = new(GitCloneOption)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitSource.
func (in *GitSource) DeepCopy() *GitSource {
if in == nil {
return nil
}
out := new(GitSource)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GithubSource) DeepCopyInto(out *GithubSource) {
*out = *in
if in.DiscoverPRFromForks != nil {
in, out := &in.DiscoverPRFromForks, &out.DiscoverPRFromForks
*out = new(DiscoverPRFromForks)
**out = **in
}
if in.CloneOption != nil {
in, out := &in.CloneOption, &out.CloneOption
*out = new(GitCloneOption)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GithubSource.
func (in *GithubSource) DeepCopy() *GithubSource {
if in == nil {
return nil
}
out := new(GithubSource)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *MultiBranchJobTrigger) DeepCopyInto(out *MultiBranchJobTrigger) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiBranchJobTrigger.
func (in *MultiBranchJobTrigger) DeepCopy() *MultiBranchJobTrigger {
if in == nil {
return nil
}
out := new(MultiBranchJobTrigger)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *MultiBranchPipeline) DeepCopyInto(out *MultiBranchPipeline) {
*out = *in
if in.Discarder != nil {
in, out := &in.Discarder, &out.Discarder
*out = new(DiscarderProperty)
**out = **in
}
if in.TimerTrigger != nil {
in, out := &in.TimerTrigger, &out.TimerTrigger
*out = new(TimerTrigger)
**out = **in
}
if in.GitSource != nil {
in, out := &in.GitSource, &out.GitSource
*out = new(GitSource)
(*in).DeepCopyInto(*out)
}
if in.GitHubSource != nil {
in, out := &in.GitHubSource, &out.GitHubSource
*out = new(GithubSource)
(*in).DeepCopyInto(*out)
}
if in.SvnSource != nil {
in, out := &in.SvnSource, &out.SvnSource
*out = new(SvnSource)
**out = **in
}
if in.SingleSvnSource != nil {
in, out := &in.SingleSvnSource, &out.SingleSvnSource
*out = new(SingleSvnSource)
**out = **in
}
if in.BitbucketServerSource != nil {
in, out := &in.BitbucketServerSource, &out.BitbucketServerSource
*out = new(BitbucketServerSource)
(*in).DeepCopyInto(*out)
}
if in.MultiBranchJobTrigger != nil {
in, out := &in.MultiBranchJobTrigger, &out.MultiBranchJobTrigger
*out = new(MultiBranchJobTrigger)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MultiBranchPipeline.
func (in *MultiBranchPipeline) DeepCopy() *MultiBranchPipeline {
if in == nil {
return nil
}
out := new(MultiBranchPipeline)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *NoScmPipeline) DeepCopyInto(out *NoScmPipeline) {
*out = *in
if in.Discarder != nil {
in, out := &in.Discarder, &out.Discarder
*out = new(DiscarderProperty)
**out = **in
}
if in.Parameters != nil {
in, out := &in.Parameters, &out.Parameters
*out = make([]Parameter, len(*in))
copy(*out, *in)
}
if in.TimerTrigger != nil {
in, out := &in.TimerTrigger, &out.TimerTrigger
*out = new(TimerTrigger)
**out = **in
}
if in.RemoteTrigger != nil {
in, out := &in.RemoteTrigger, &out.RemoteTrigger
*out = new(RemoteTrigger)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NoScmPipeline.
func (in *NoScmPipeline) DeepCopy() *NoScmPipeline {
if in == nil {
return nil
}
out := new(NoScmPipeline)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Parameter) DeepCopyInto(out *Parameter) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Parameter.
func (in *Parameter) DeepCopy() *Parameter {
if in == nil {
return nil
}
out := new(Parameter)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Pipeline) DeepCopyInto(out *Pipeline) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
out.Status = in.Status
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Pipeline.
func (in *Pipeline) DeepCopy() *Pipeline {
if in == nil {
return nil
}
out := new(Pipeline)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *Pipeline) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PipelineList) DeepCopyInto(out *PipelineList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Pipeline, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineList.
func (in *PipelineList) DeepCopy() *PipelineList {
if in == nil {
return nil
}
out := new(PipelineList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *PipelineList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PipelineSpec) DeepCopyInto(out *PipelineSpec) {
*out = *in
if in.Pipeline != nil {
in, out := &in.Pipeline, &out.Pipeline
*out = new(NoScmPipeline)
(*in).DeepCopyInto(*out)
}
if in.MultiBranchPipeline != nil {
in, out := &in.MultiBranchPipeline, &out.MultiBranchPipeline
*out = new(MultiBranchPipeline)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineSpec.
func (in *PipelineSpec) DeepCopy() *PipelineSpec {
if in == nil {
return nil
}
out := new(PipelineSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PipelineStatus) DeepCopyInto(out *PipelineStatus) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineStatus.
func (in *PipelineStatus) DeepCopy() *PipelineStatus {
if in == nil {
return nil
}
out := new(PipelineStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *RemoteTrigger) DeepCopyInto(out *RemoteTrigger) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RemoteTrigger.
func (in *RemoteTrigger) DeepCopy() *RemoteTrigger {
if in == nil {
return nil
}
out := new(RemoteTrigger)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SingleSvnSource) DeepCopyInto(out *SingleSvnSource) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SingleSvnSource.
func (in *SingleSvnSource) DeepCopy() *SingleSvnSource {
if in == nil {
return nil
}
out := new(SingleSvnSource)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SvnSource) DeepCopyInto(out *SvnSource) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SvnSource.
func (in *SvnSource) DeepCopy() *SvnSource {
if in == nil {
return nil
}
out := new(SvnSource)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TimerTrigger) DeepCopyInto(out *TimerTrigger) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TimerTrigger.
func (in *TimerTrigger) DeepCopy() *TimerTrigger {
if in == nil {
return nil
}
out := new(TimerTrigger)
in.DeepCopyInto(out)
return out
}