Documentation ¶
Index ¶
- Constants
- type AppLabelDto
- type AppLabelsDto
- type AppMetaInfoDto
- type BuildBinaryConfig
- type CDMaterialMetadata
- type CDPatchRequest
- type CDPipelineConfigObject
- type CDPipelineViewObject
- type CDSourceObject
- type CdPatchAction
- type CdPipelines
- type CdStage
- type CiArtifactBean
- type CiArtifactResponse
- type CiConfigRequest
- type CiMaterial
- type CiPatchRequest
- type CiPipeline
- type CiPipelineMaterial
- type CiPipelineMin
- type CiRegexPatchRequest
- type CiScript
- type CiTrigger
- type CiTriggerRequest
- type CreateAppDTO
- type CreateMaterialDTO
- type DockerBuildConfig
- type Environment
- type EnvironmentGroup
- type ExposeType
- type ExternalCiConfig
- type GitCiTriggerRequest
- type GitCommit
- type GitMaterial
- type HelmConfig
- type Job
- type Label
- type Material
- type MaterialMetadata
- type MaterialOperations
- type MonitoringConfig
- type PackagingConfig
- type PatchAction
- type Pipeline
- type PipelineCreateResponse
- type PipelineType
- type PostStageConfigMapSecretNames
- type PreStageConfigMapSecretNames
- type PropertiesConfig
- type Rollback
- type Scheme
- type ServiceExposeConfig
- type SourceType
- type SourceTypeConfig
- type Stage
- type Strategy
- type Task
- type Test
- type TestExecutorImageProperties
- type ThirdPartyMonitoringConfig
- type UpdateMaterialDTO
- type WebhookData
Constants ¶
View Source
const ( LayoutISO = "2006-01-02 15:04:05" LayoutUS = "January 2, 2006 15:04:05" LayoutRFC3339 = "2006-01-02T15:04:05Z07:00" )
View Source
const ( WEBHOOK_SELECTOR_UNIQUE_ID_NAME string = "unique id" WEBHOOK_SELECTOR_REPOSITORY_URL_NAME string = "repository url" WEBHOOK_SELECTOR_HEADER_NAME string = "header" WEBHOOK_SELECTOR_GIT_URL_NAME string = "git url" WEBHOOK_SELECTOR_AUTHOR_NAME string = "author" WEBHOOK_SELECTOR_DATE_NAME string = "date" WEBHOOK_SELECTOR_TARGET_CHECKOUT_NAME string = "target checkout" WEBHOOK_SELECTOR_SOURCE_CHECKOUT_NAME string = "source checkout" WEBHOOK_SELECTOR_TARGET_BRANCH_NAME_NAME string = "target branch name" WEBHOOK_SELECTOR_SOURCE_BRANCH_NAME_NAME string = "source branch name" WEBHOOK_EVENT_MERGED_ACTION_TYPE string = "merged" WEBHOOK_EVENT_NON_MERGED_ACTION_TYPE string = "non-merged" )
View Source
const ( EXPOSE_INTERNAL ExposeType = "clusterIp" EXPOSE_EXTERNAL ExposeType = "elb" SCHEME_HTTP Scheme = "http" SCHEME_HTTPS Scheme = "https" SCHEME_TCP Scheme = "tcp" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppLabelDto ¶ added in v0.2.23
type AppLabelsDto ¶ added in v0.2.23
type AppMetaInfoDto ¶ added in v0.2.21
type AppMetaInfoDto struct { AppId int `json:"appId"` AppName string `json:"appName"` ProjectId int `json:"projectId"` ProjectName string `json:"projectName"` CreatedBy string `json:"createdBy"` CreatedOn time.Time `json:"createdOn"` Active bool `json:"active,notnull"` Labels []*Label `json:"labels"` UserId int32 `json:"-"` }
type BuildBinaryConfig ¶
type BuildBinaryConfig struct { Name string `json:"name"` Stages []Stage `json:"stages"` //stages will be executed sequentially }
user should be able to compose multiple sequential and parallel steps for building binary.
type CDMaterialMetadata ¶
type CDMaterialMetadata struct { Url string `json:"url,omitempty"` Branch string `json:"branch,omitempty"` Tag string `json:"tag,omitempty"` }
--------- cd related struct ---------
type CDPatchRequest ¶
type CDPatchRequest struct { Pipeline *CDPipelineConfigObject `json:"pipeline,omitempty"` AppId int `json:"appId,omitempty"` Action CdPatchAction `json:"action,omitempty"` UserId int32 `json:"-"` ForceDelete bool `json:"-"` }
type CDPipelineConfigObject ¶
type CDPipelineConfigObject struct { Id int `json:"id,omitempty" validate:"number" ` EnvironmentId int `json:"environmentId,omitempty" validate:"number,required" ` EnvironmentName string `json:"environmentName,omitempty" ` CiPipelineId int `json:"ciPipelineId,omitempty" validate:"number,required"` TriggerType pipelineConfig.TriggerType `json:"triggerType,omitempty" validate:"oneof=AUTOMATIC MANUAL"` Name string `json:"name,omitempty" validate:"name-component,max=50"` //pipelineName Strategies []Strategy `json:"strategies,omitempty"` Namespace string `json:"namespace,omitempty" validate:"name-component,max=50"` //namespace AppWorkflowId int `json:"appWorkflowId,omitempty" ` DeploymentTemplate pipelineConfig.DeploymentTemplate `json:"deploymentTemplate,omitempty" validate:"oneof=BLUE-GREEN ROLLING CANARY RECREATE"` // PreStage CdStage `json:"preStage"` PostStage CdStage `json:"postStage"` PreStageConfigMapSecretNames PreStageConfigMapSecretNames `json:"preStageConfigMapSecretNames"` PostStageConfigMapSecretNames PostStageConfigMapSecretNames `json:"postStageConfigMapSecretNames"` RunPreStageInEnv bool `json:"runPreStageInEnv"` RunPostStageInEnv bool `json:"runPostStageInEnv"` CdArgoSetup bool `json:"isClusterCdActive"` ParentPipelineId int `json:"parentPipelineId"` ParentPipelineType string `json:"parentPipelineType"` DeploymentAppType string `json:"deploymentAppType"` }
type CDPipelineViewObject ¶
type CDPipelineViewObject struct { Id int `json:"id"` PipelineCounter int `json:"pipelineCounter"` Environment string `json:"environment"` Downstream []int `json:"downstream"` //PipelineCounter of downstream Status string `json:"status"` Message string `json:"message"` ProgressText string `json:"progress_text"` PipelineType pipelineConfig.PipelineType `json:"pipelineType"` GitDiffUrl string `json:"git_diff_url"` PipelineHistoryUrl string `json:"pipeline_history_url"` //remove Rollback Rollback `json:"rollback"` Name string `json:"-"` CDSourceObject }
type CDSourceObject ¶
type CDSourceObject struct { Id int `json:"id"` DisplayName string `json:"displayName"` Metadata CDMaterialMetadata `json:"metadata"` }
type CdPatchAction ¶
type CdPatchAction int
const ( CD_CREATE CdPatchAction = iota CD_DELETE //delete this pipeline CD_UPDATE )
func (CdPatchAction) String ¶
func (a CdPatchAction) String() string
type CdPipelines ¶
type CdPipelines struct { Pipelines []*CDPipelineConfigObject `json:"pipelines,omitempty" validate:"dive"` AppId int `json:"appId,omitempty" validate:"number,required" ` UserId int32 `json:"-"` }
type CdStage ¶
type CdStage struct { TriggerType pipelineConfig.TriggerType `json:"triggerType,omitempty"` Name string `json:"name,omitempty"` Status string `json:"status,omitempty"` Config string `json:"config,omitempty"` }
type CiArtifactBean ¶
type CiArtifactBean struct { Id int `json:"id"` Image string `json:"image,notnull"` ImageDigest string `json:"image_digest,notnull"` MaterialInfo json.RawMessage `json:"material_info"` //git material metadata json array string DataSource string `json:"data_source,notnull"` DeployedTime string `json:"deployed_time"` Deployed bool `json:"deployed,notnull"` Latest bool `json:"latest,notnull"` LastSuccessfulTriggerOnParent bool `json:"lastSuccessfulTriggerOnParent,notnull"` RunningOnParentCd bool `json:"runningOnParentCd,omitempty"` IsVulnerable bool `json:"vulnerable,notnull"` ScanEnabled bool `json:"scanEnabled,notnull"` Scanned bool `json:"scanned,notnull"` }
type CiArtifactResponse ¶
type CiArtifactResponse struct { //AppId int `json:"app_id"` CdPipelineId int `json:"cd_pipeline_id,notnull"` CiArtifacts []CiArtifactBean `json:"ci_artifacts,notnull"` }
type CiConfigRequest ¶
type CiConfigRequest struct { Id int `json:"id,omitempty" validate:"number"` //ciTemplateId AppId int `json:"appId,omitempty" validate:"required,number"` DockerRegistry string `json:"dockerRegistry,omitempty" ` //repo id example ecr mapped one-one with gocd registry entry DockerRepository string `json:"dockerRepository,omitempty"` // example test-app-1 which is inside ecr DockerBuildConfig *DockerBuildConfig `json:"dockerBuildConfig,omitempty" validate:"required,dive"` CiPipelines []*CiPipeline `json:"ciPipelines,omitempty" validate:"dive"` //a pipeline will be built for each ciMaterial AppName string `json:"appName,omitempty"` Version string `json:"version,omitempty"` //gocd etag used for edit purpose DockerRegistryUrl string `json:"-"` CiTemplateName string `json:"-"` UserId int32 `json:"-"` Materials []Material `json:"materials"` AppWorkflowId int `json:"appWorkflowId,omitempty"` BeforeDockerBuild []*Task `json:"beforeDockerBuild,omitempty" validate:"dive"` AfterDockerBuild []*Task `json:"afterDockerBuild,omitempty" validate:"dive"` ScanEnabled bool `json:"scanEnabled,notnull"` }
type CiMaterial ¶
type CiMaterial struct { Source *SourceTypeConfig `json:"source,omitempty" validate:"dive,required"` //branch for ci Path string `json:"path,omitempty"` // defaults to root of git repo CheckoutPath string `json:"checkoutPath,omitempty"` //path where code will be checked out for single source `./` default for multiSource configured by user GitMaterialId int `json:"gitMaterialId,omitempty" validate:"required"` //id stored in db GitMaterial( foreign key) ScmId string `json:"scmId,omitempty"` //id of gocd object ScmName string `json:"scmName,omitempty"` ScmVersion string `json:"scmVersion,omitempty"` Id int `json:"id,omitempty"` GitMaterialName string `json:"gitMaterialName"` IsRegex bool `json:"isRegex"` }
type CiPatchRequest ¶
type CiPatchRequest struct { CiPipeline *CiPipeline `json:"ciPipeline"` AppId int `json:"appId,omitempty"` Action PatchAction `json:"action"` AppWorkflowId int `json:"appWorkflowId,omitempty"` UserId int32 `json:"-"` }
----------------
type CiPipeline ¶
type CiPipeline struct { IsManual bool `json:"isManual"` DockerArgs map[string]string `json:"dockerArgs"` IsExternal bool `json:"isExternal"` ParentCiPipeline int `json:"parentCiPipeline"` ParentAppId int `json:"parentAppId"` ExternalCiConfig ExternalCiConfig `json:"externalCiConfig"` CiMaterial []*CiMaterial `json:"ciMaterial,omitempty" validate:"dive,min=1"` Name string `json:"name,omitempty" validate:"name-component,max=100"` //name suffix of corresponding pipeline. required, unique, validation corresponding to gocd pipelineName will be applicable Id int `json:"id,omitempty" ` Version string `json:"version,omitempty"` //matchIf token version in gocd . used for update request Active bool `json:"active,omitempty"` //pipeline is active or not Deleted bool `json:"deleted,omitempty"` BeforeDockerBuild []*Task `json:"beforeDockerBuild,omitempty" validate:"dive"` AfterDockerBuild []*Task `json:"afterDockerBuild,omitempty" validate:"dive"` BeforeDockerBuildScripts []*CiScript `json:"beforeDockerBuildScripts,omitempty" validate:"dive"` AfterDockerBuildScripts []*CiScript `json:"afterDockerBuildScripts,omitempty" validate:"dive"` LinkedCount int `json:"linkedCount"` PipelineType PipelineType `json:"pipelineType,omitempty"` ScanEnabled bool `json:"scanEnabled,notnull"` AppWorkflowId int `json:"appWorkflowId,omitempty"` PreBuildStage *bean.PipelineStageDto `json:"preBuildStage,omitempty"` PostBuildStage *bean.PipelineStageDto `json:"postBuildStage,omitempty"` TargetPlatform string `json:"targetPlatform,omitempty"` }
type CiPipelineMaterial ¶
type CiPipelineMin ¶
type CiPipelineMin struct { Name string `json:"name,omitempty" validate:"name-component,max=100"` //name suffix of corresponding pipeline. required, unique, validation corresponding to gocd pipelineName will be applicable Id int `json:"id,omitempty" ` Version string `json:"version,omitempty"` //matchIf token version in gocd . used for update request IsExternal bool `json:"isExternal,omitempty"` ParentCiPipeline int `json:"parentCiPipeline"` ParentAppId int `json:"parentAppId"` PipelineType PipelineType `json:"pipelineType,omitempty"` ScanEnabled bool `json:"scanEnabled,notnull"` }
type CiRegexPatchRequest ¶ added in v0.4.28
type CiRegexPatchRequest struct { CiPipelineMaterial []*CiPipelineMaterial `json:"ciPipelineMaterial,omitempty"` Id int `json:"id,omitempty" ` AppId int `json:"appId,omitempty"` UserId int32 `json:"-"` }
type CiTriggerRequest ¶
type CiTriggerRequest struct { PipelineId int `json:"pipelineId"` CiPipelineMaterial []CiPipelineMaterial `json:"ciPipelineMaterials" validate:"required"` TriggeredBy int32 `json:"triggeredBy"` InvalidateCache bool `json:"invalidateCache"` }
type CreateAppDTO ¶
type CreateAppDTO struct { Id int `json:"id,omitempty" validate:"number"` AppName string `json:"appName" validate:"name-component,max=100"` UserId int32 `json:"-"` //not exposed to UI Material []*GitMaterial `json:"material" validate:"dive,min=1"` TeamId int `json:"teamId,omitempty" validate:"number,required"` TemplateId int `json:"templateId"` AppLabels []*Label `json:"labels,omitempty" validate:"dive"` }
type CreateMaterialDTO ¶
type CreateMaterialDTO struct { Id int `json:"id,omitempty" validate:"number"` AppId int `json:"appId" validate:"number"` Material []*GitMaterial `json:"material" validate:"dive,min=1"` UserId int32 `json:"-"` //not exposed to UI }
type DockerBuildConfig ¶
type Environment ¶
type Environment struct {
Values string
}
set of unique attributes which corresponds to a cluster different environment of gocd and k8s cluster.
type EnvironmentGroup ¶
type EnvironmentGroup struct { Name string Environments []Environment }
if Environments has multiple entries then application of them will be deployed simultaneously
type ExposeType ¶
type ExposeType string
type ExternalCiConfig ¶
type GitCiTriggerRequest ¶
type GitCiTriggerRequest struct { CiPipelineMaterial CiPipelineMaterial `json:"ciPipelineMaterial" validate:"required"` TriggeredBy int32 `json:"triggeredBy"` }
type GitCommit ¶
type GitCommit struct { Commit string //git hash Author string Date time.Time Message string Changes []string WebhookData *WebhookData GitRepoUrl string GitRepoName string CiConfigureSourceType pipelineConfig.SourceType CiConfigureSourceValue string }
type GitMaterial ¶
type GitMaterial struct { Name string `json:"name,omitempty" ` //not null, //default format pipelineGroup.AppName + "-" + inputMaterial.Name, Url string `json:"url,omitempty"` //url of git repo Id int `json:"id,omitempty" validate:"number"` GitProviderId int `json:"gitProviderId,omitempty" validate:"gt=0"` CheckoutPath string `json:"checkoutPath" validate:"checkout-path-component"` FetchSubmodules bool `json:"fetchSubmodules"` }
type HelmConfig ¶
type HelmConfig struct { }
contains reference to chart and values.yaml changes for next deploy
type MaterialMetadata ¶
type MaterialMetadata struct { ProgrammingLang string LanguageRuntime string BuildTool string Executables []string Profiles map[string]string // pipeline-stage, profile LogDirs map[string]string //file, log pattern EnvironmentVariables map[string]string PropertiesConfig []PropertiesConfig ExposeConfig []ServiceExposeConfig //a mocroservice can be exposed in multiple ways MonitoringConfig MonitoringConfig }
type MaterialOperations ¶
type MaterialOperations interface { MaterialExists(material *GitMaterial) (bool, error) SaveMaterial(material *GitMaterial) error GenerateMaterialMetaData(material *GitMaterial) (*MaterialMetadata, error) ValidateMaterialMetaData(material *GitMaterial, metadata *MaterialMetadata) (bool, error) SaveMaterialMetaData(metadata *MaterialMetadata) error }
type MonitoringConfig ¶
type PackagingConfig ¶
type PackagingConfig struct { }
tag git build binary push binary to artifact store build docker image push docker image docker args
type PatchAction ¶
type PatchAction int
-------------------
const ( CREATE PatchAction = iota UPDATE_SOURCE //update value of SourceTypeConfig DELETE //delete this pipeline )
func (PatchAction) String ¶
func (a PatchAction) String() string
type Pipeline ¶
type Pipeline struct {
Environment Environment
}
type PipelineCreateResponse ¶
type PipelineType ¶
type PipelineType string
const ( NORMAL PipelineType = "NORMAL" LINKED PipelineType = "LINKED" EXTERNAL PipelineType = "EXTERNAL" )
type PropertiesConfig ¶
type ServiceExposeConfig ¶
type SourceType ¶
type SourceType string
type SourceTypeConfig ¶
type SourceTypeConfig struct { Type pipelineConfig.SourceType `json:"type,omitempty" validate:"oneof=SOURCE_TYPE_BRANCH_FIXED SOURCE_TYPE_BRANCH_REGEX SOURCE_TYPE_TAG_ANY WEBHOOK"` Value string `json:"value,omitempty" ` Regex string `json:"regex"` }
type Strategy ¶
type Strategy struct { DeploymentTemplate pipelineConfig.DeploymentTemplate `json:"deploymentTemplate,omitempty" validate:"oneof=BLUE-GREEN ROLLING CANARY RECREATE"` // Config json.RawMessage `json:"config,omitempty" validate:"string"` Default bool `json:"default"` }
type ThirdPartyMonitoringConfig ¶
type ThirdPartyMonitoringConfig struct { }
type UpdateMaterialDTO ¶
type UpdateMaterialDTO struct { AppId int `json:"appId" validate:"number"` Material *GitMaterial `json:"material" validate:"dive,min=1"` UserId int32 `json:"-"` //not exposed to UI }
Click to show internal directories.
Click to hide internal directories.