@@ -38,6 +38,12 @@ spec:
|
|||||||
type: object
|
type: object
|
||||||
status:
|
status:
|
||||||
description: DevOpsProjectStatus defines the observed state of DevOpsProject
|
description: DevOpsProjectStatus defines the observed state of DevOpsProject
|
||||||
|
properties:
|
||||||
|
adminNamespace:
|
||||||
|
description: 'INSERT ADDITIONAL STATUS FIELD - define observed state
|
||||||
|
of cluster Important: Run "make" to regenerate code after modifying
|
||||||
|
this file'
|
||||||
|
type: string
|
||||||
type: object
|
type: object
|
||||||
type: object
|
type: object
|
||||||
version: v1alpha3
|
version: v1alpha3
|
||||||
|
|||||||
260
config/crds/devops.kubesphere.io_pipelines.yaml
generated
Normal file
260
config/crds/devops.kubesphere.io_pipelines.yaml
generated
Normal file
@@ -0,0 +1,260 @@
|
|||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: apiextensions.k8s.io/v1beta1
|
||||||
|
kind: CustomResourceDefinition
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
controller-gen.kubebuilder.io/version: (unknown)
|
||||||
|
creationTimestamp: null
|
||||||
|
name: pipelines.devops.kubesphere.io
|
||||||
|
spec:
|
||||||
|
group: devops.kubesphere.io
|
||||||
|
names:
|
||||||
|
kind: Pipeline
|
||||||
|
listKind: PipelineList
|
||||||
|
plural: pipelines
|
||||||
|
singular: pipeline
|
||||||
|
scope: Namespaced
|
||||||
|
validation:
|
||||||
|
openAPIV3Schema:
|
||||||
|
description: Pipeline is the Schema for the pipelines API
|
||||||
|
properties:
|
||||||
|
apiVersion:
|
||||||
|
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
|
||||||
|
kind:
|
||||||
|
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
|
||||||
|
metadata:
|
||||||
|
type: object
|
||||||
|
spec:
|
||||||
|
description: PipelineSpec defines the desired state of Pipeline
|
||||||
|
properties:
|
||||||
|
multi_branch_pipeline:
|
||||||
|
properties:
|
||||||
|
bitbucket_server_source:
|
||||||
|
properties:
|
||||||
|
api_uri:
|
||||||
|
type: string
|
||||||
|
credential_id:
|
||||||
|
type: string
|
||||||
|
discover_branches:
|
||||||
|
type: integer
|
||||||
|
discover_pr_from_forks:
|
||||||
|
properties:
|
||||||
|
strategy:
|
||||||
|
type: integer
|
||||||
|
trust:
|
||||||
|
type: integer
|
||||||
|
type: object
|
||||||
|
discover_pr_from_origin:
|
||||||
|
type: integer
|
||||||
|
git_clone_option:
|
||||||
|
properties:
|
||||||
|
depth:
|
||||||
|
type: integer
|
||||||
|
shallow:
|
||||||
|
type: boolean
|
||||||
|
timeout:
|
||||||
|
type: integer
|
||||||
|
type: object
|
||||||
|
owner:
|
||||||
|
type: string
|
||||||
|
regex_filter:
|
||||||
|
type: string
|
||||||
|
repo:
|
||||||
|
type: string
|
||||||
|
scm_id:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
descriptio:
|
||||||
|
type: string
|
||||||
|
discarder:
|
||||||
|
properties:
|
||||||
|
days_to_keep:
|
||||||
|
type: string
|
||||||
|
num_to_keep:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
git_source:
|
||||||
|
properties:
|
||||||
|
credential_id:
|
||||||
|
type: string
|
||||||
|
discover_branches:
|
||||||
|
type: boolean
|
||||||
|
git_clone_option:
|
||||||
|
properties:
|
||||||
|
depth:
|
||||||
|
type: integer
|
||||||
|
shallow:
|
||||||
|
type: boolean
|
||||||
|
timeout:
|
||||||
|
type: integer
|
||||||
|
type: object
|
||||||
|
regex_filter:
|
||||||
|
type: string
|
||||||
|
scm_id:
|
||||||
|
type: string
|
||||||
|
url:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
github_source:
|
||||||
|
properties:
|
||||||
|
api_uri:
|
||||||
|
type: string
|
||||||
|
credential_id:
|
||||||
|
type: string
|
||||||
|
discover_branches:
|
||||||
|
type: integer
|
||||||
|
discover_pr_from_forks:
|
||||||
|
properties:
|
||||||
|
strategy:
|
||||||
|
type: integer
|
||||||
|
trust:
|
||||||
|
type: integer
|
||||||
|
type: object
|
||||||
|
discover_pr_from_origin:
|
||||||
|
type: integer
|
||||||
|
git_clone_option:
|
||||||
|
properties:
|
||||||
|
depth:
|
||||||
|
type: integer
|
||||||
|
shallow:
|
||||||
|
type: boolean
|
||||||
|
timeout:
|
||||||
|
type: integer
|
||||||
|
type: object
|
||||||
|
owner:
|
||||||
|
type: string
|
||||||
|
regex_filter:
|
||||||
|
type: string
|
||||||
|
repo:
|
||||||
|
type: string
|
||||||
|
scm_id:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
multibranch_job_trigger:
|
||||||
|
properties:
|
||||||
|
create_action_job_to_trigger:
|
||||||
|
type: string
|
||||||
|
delete_action_job_to_trigger:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
script_path:
|
||||||
|
type: string
|
||||||
|
single_svn_source:
|
||||||
|
properties:
|
||||||
|
credential_id:
|
||||||
|
type: string
|
||||||
|
remote:
|
||||||
|
type: string
|
||||||
|
scm_id:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
source_type:
|
||||||
|
type: string
|
||||||
|
svn_source:
|
||||||
|
properties:
|
||||||
|
credential_id:
|
||||||
|
type: string
|
||||||
|
excludes:
|
||||||
|
type: string
|
||||||
|
includes:
|
||||||
|
type: string
|
||||||
|
remote:
|
||||||
|
type: string
|
||||||
|
scm_id:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
timer_trigger:
|
||||||
|
properties:
|
||||||
|
cron:
|
||||||
|
description: user in no scm job
|
||||||
|
type: string
|
||||||
|
interval:
|
||||||
|
description: use in multi-branch job
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- name
|
||||||
|
- script_path
|
||||||
|
- source_type
|
||||||
|
type: object
|
||||||
|
pipeline:
|
||||||
|
properties:
|
||||||
|
descriptio:
|
||||||
|
type: string
|
||||||
|
disable_concurrent:
|
||||||
|
type: boolean
|
||||||
|
discarder:
|
||||||
|
properties:
|
||||||
|
days_to_keep:
|
||||||
|
type: string
|
||||||
|
num_to_keep:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
jenkinsfile:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
parameters:
|
||||||
|
items:
|
||||||
|
properties:
|
||||||
|
default_value:
|
||||||
|
type: string
|
||||||
|
description:
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- name
|
||||||
|
- type
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
|
remote_trigger:
|
||||||
|
properties:
|
||||||
|
token:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
timer_trigger:
|
||||||
|
properties:
|
||||||
|
cron:
|
||||||
|
description: user in no scm job
|
||||||
|
type: string
|
||||||
|
interval:
|
||||||
|
description: use in multi-branch job
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- name
|
||||||
|
type: object
|
||||||
|
type:
|
||||||
|
description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
|
||||||
|
Important: Run "make" to regenerate code after modifying this file'
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- type
|
||||||
|
type: object
|
||||||
|
status:
|
||||||
|
description: PipelineStatus defines the observed state of Pipeline
|
||||||
|
type: object
|
||||||
|
type: object
|
||||||
|
version: v1alpha3
|
||||||
|
versions:
|
||||||
|
- name: v1alpha3
|
||||||
|
served: true
|
||||||
|
storage: true
|
||||||
|
status:
|
||||||
|
acceptedNames:
|
||||||
|
kind: ""
|
||||||
|
plural: ""
|
||||||
|
conditions: []
|
||||||
|
storedVersions: []
|
||||||
@@ -2,7 +2,6 @@ package devops
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Credential struct {
|
type Credential struct {
|
||||||
@@ -24,12 +23,6 @@ type Credential struct {
|
|||||||
} `json:"fingerprint,omitempty" description:"usage of the Credential"`
|
} `json:"fingerprint,omitempty" description:"usage of the Credential"`
|
||||||
Description string `json:"description,omitempty" description:"Credential's description'"`
|
Description string `json:"description,omitempty" description:"Credential's description'"`
|
||||||
Domain string `json:"domain,omitempty" description:"Credential's domain,In ks we only use the default domain, default '_''"`
|
Domain string `json:"domain,omitempty" description:"Credential's domain,In ks we only use the default domain, default '_''"`
|
||||||
CreateTime *time.Time `json:"create_time,omitempty" description:"Credential's create_time'"`
|
|
||||||
Creator string `json:"creator,omitempty" description:"Creator's username"`
|
|
||||||
UsernamePasswordCredential *UsernamePasswordCredential `json:"username_password,omitempty" description:"username password Credential struct"`
|
|
||||||
SshCredential *SshCredential `json:"ssh,omitempty" description:"ssh Credential struct"`
|
|
||||||
SecretTextCredential *SecretTextCredential `json:"secret_text,omitempty" description:"secret_text Credential struct"`
|
|
||||||
KubeconfigCredential *KubeconfigCredential `json:"kubeconfig,omitempty" description:"kubeconfig Credential struct"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type UsernamePasswordCredential struct {
|
type UsernamePasswordCredential struct {
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ func New(projects ...string) *Devops {
|
|||||||
Data: nil,
|
Data: nil,
|
||||||
Projects: map[string]interface{}{},
|
Projects: map[string]interface{}{},
|
||||||
Pipelines: map[string]map[string]*devopsv1alpha3.Pipeline{},
|
Pipelines: map[string]map[string]*devopsv1alpha3.Pipeline{},
|
||||||
|
Credentials: map[string]map[string]*v1.Secret{},
|
||||||
}
|
}
|
||||||
for _, p := range projects {
|
for _, p := range projects {
|
||||||
d.Projects[p] = true
|
d.Projects[p] = true
|
||||||
@@ -38,6 +39,7 @@ func NewWithPipelines(project string, pipelines ...*devopsv1alpha3.Pipeline) *De
|
|||||||
Data: nil,
|
Data: nil,
|
||||||
Projects: map[string]interface{}{},
|
Projects: map[string]interface{}{},
|
||||||
Pipelines: map[string]map[string]*devopsv1alpha3.Pipeline{},
|
Pipelines: map[string]map[string]*devopsv1alpha3.Pipeline{},
|
||||||
|
Credentials: map[string]map[string]*v1.Secret{},
|
||||||
}
|
}
|
||||||
|
|
||||||
d.Projects[project] = true
|
d.Projects[project] = true
|
||||||
|
|||||||
Reference in New Issue
Block a user