tasks

package
v0.0.0-...-1fa52ee Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2024 License: Apache-2.0, BSD-2-Clause, ISC, + 1 more Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SUCCESS   = "SUCCESS"
	FAILURE   = "FAILURE"
	FAILED    = "FAILED"
	ABORTED   = "ABORTED"
	NOT_BUILD = "NOT_BUILD"
	UNSTABLE  = "UNSTABLE"
)
View Source
const RAW_BUILD_TABLE = "jenkins_api_builds"
View Source
const RAW_JOB_TABLE = "jenkins_api_jobs"
View Source
const RAW_STAGE_TABLE = "jenkins_api_stages"

Variables

View Source
var CollectApiBuildsMeta = plugin.SubTaskMeta{
	Name:             "collectApiBuilds",
	EntryPoint:       CollectApiBuilds,
	EnabledByDefault: true,
	Description:      "Collect builds data from jenkins api, supports both timeFilter and diffSync.",
	DomainTypes:      []string{plugin.DOMAIN_TYPE_CICD},
}
View Source
var CollectApiStagesMeta = plugin.SubTaskMeta{
	Name:             "collectApiStages",
	EntryPoint:       CollectApiStages,
	EnabledByDefault: true,
	Description:      "Collect stages data from jenkins api, supports timeFilter but not diffSync.",
	DomainTypes:      []string{plugin.DOMAIN_TYPE_CICD},
}
View Source
var ConvertBuildReposMeta = plugin.SubTaskMeta{
	Name:             "convertBuildRepos",
	EntryPoint:       ConvertBuildRepos,
	EnabledByDefault: true,
	Description:      "Convert tool layer table jenkins_builds into  domain layer table builds",
	DomainTypes:      []string{plugin.DOMAIN_TYPE_CICD},
}
View Source
var ConvertBuildsToCicdTasksMeta = plugin.SubTaskMeta{
	Name:             "convertBuildsToCICD",
	EntryPoint:       ConvertBuildsToCicdTasks,
	EnabledByDefault: true,
	Description:      "convert builds to cicd",
	DomainTypes:      []string{plugin.DOMAIN_TYPE_CICD},
}
View Source
var ConvertJobsMeta = plugin.SubTaskMeta{
	Name:             "convertJobs",
	EntryPoint:       ConvertJobs,
	EnabledByDefault: true,
	Description:      "Convert tool layer table jenkins_jobs into  domain layer table jobs",
	DomainTypes:      []string{plugin.DOMAIN_TYPE_CICD},
}
View Source
var ConvertStagesMeta = plugin.SubTaskMeta{
	Name:             "convertStages",
	EntryPoint:       ConvertStages,
	EnabledByDefault: true,
	Description:      "convert jenkins_stages",
	DomainTypes:      []string{plugin.DOMAIN_TYPE_CICD},
}
View Source
var EnrichApiBuildWithStagesMeta = plugin.SubTaskMeta{
	Name:             "enrichApiBuildWithStages",
	EntryPoint:       EnrichApiBuildWithStages,
	EnabledByDefault: true,
	Description:      "Enrich  jenkins build with stages",
	DomainTypes:      []string{plugin.DOMAIN_TYPE_CICD},
}
View Source
var ExtractApiBuildsMeta = plugin.SubTaskMeta{
	Name:             "extractApiBuilds",
	EntryPoint:       ExtractApiBuilds,
	EnabledByDefault: true,
	Description:      "Extract raw builds data into tool layer table jenkins_builds",
	DomainTypes:      []string{plugin.DOMAIN_TYPE_CICD},
}
View Source
var ExtractApiStagesMeta = plugin.SubTaskMeta{
	Name:             "extractApiStages",
	EntryPoint:       ExtractApiStages,
	EnabledByDefault: true,
	Description:      "Extract raw stages data into tool layer table jenkins_stages",
	DomainTypes:      []string{plugin.DOMAIN_TYPE_CICD},
}

Functions

func CollectApiBuilds

func CollectApiBuilds(taskCtx plugin.SubTaskContext) errors.Error

func CollectApiStages

func CollectApiStages(taskCtx plugin.SubTaskContext) errors.Error

func ConvertBuildRepos

func ConvertBuildRepos(taskCtx plugin.SubTaskContext) errors.Error

func ConvertBuildsToCicdTasks

func ConvertBuildsToCicdTasks(taskCtx plugin.SubTaskContext) (err errors.Error)

func ConvertJobs

func ConvertJobs(taskCtx plugin.SubTaskContext) errors.Error

func ConvertStages

func ConvertStages(taskCtx plugin.SubTaskContext) (err errors.Error)

func CreateApiClient

func CreateApiClient(taskCtx plugin.TaskContext, connection *models.JenkinsConnection) (*api.ApiAsyncClient, errors.Error)

func EnrichApiBuildWithStages

func EnrichApiBuildWithStages(taskCtx plugin.SubTaskContext) errors.Error

func ExtractApiBuilds

func ExtractApiBuilds(taskCtx plugin.SubTaskContext) errors.Error

func ExtractApiStages

func ExtractApiStages(taskCtx plugin.SubTaskContext) errors.Error

Types

type JenkinsApiParams

type JenkinsApiParams models.JenkinsApiParams

type JenkinsBuildWithRepoStage

type JenkinsBuildWithRepoStage struct {
	// collected fields
	ConnectionId        uint64 `gorm:"primaryKey"`
	ID                  string `json:"id" gorm:"primaryKey;type:varchar(255)"`
	Name                string `json:"name" gorm:"type:varchar(255)"`
	ExecNode            string `json:"execNode" gorm:"type:varchar(255)"`
	CommitSha           string `gorm:"type:varchar(255)"`
	Result              string // Result
	Status              string `json:"status" gorm:"type:varchar(255)"`
	StartTimeMillis     int64  `json:"startTimeMillis"`
	DurationMillis      int    `json:"durationMillis"`
	PauseDurationMillis int    `json:"pauseDurationMillis"`
	Type                string `gorm:"index;type:varchar(255)"`
	BuildName           string `gorm:"primaryKey;type:varchar(255)"`
	Branch              string `gorm:"type:varchar(255)"`
	RepoUrl             string `gorm:"type:varchar(255)"`
	common.NoPKModel
}

type JenkinsOptions

type JenkinsOptions struct {
	ConnectionId         uint64                     `json:"connectionId" mapstructure:"connectionId"`
	ScopeConfigId        uint64                     `json:"scopeConfigId" mapstructure:"scopeConfigId,omitempty"`
	FullName             string                     `json:"fullName,omitempty" mapstructure:"fullName,omitempty"`       // "path1/path2/job name"
	JobFullName          string                     `json:"jobFullName,omitempty" mapstructure:"jobFullName,omitempty"` // "path1/path2/job name"
	JobName              string                     `json:"jobName,omitempty" mapstructure:"jobName,omitempty"`         // "job name"
	JobPath              string                     `json:"jobPath,omitempty" mapstructure:"jobPath,omitempty"`         // "job/path1/job/path2"
	Tasks                []string                   `json:"tasks,omitempty" mapstructure:"tasks,omitempty"`
	ScopeConfig          *models.JenkinsScopeConfig `mapstructure:"scopeConfig" json:"scopeConfig"`
	api.CollectorOptions `mapstructure:",squash"`
}

func DecodeTaskOptions

func DecodeTaskOptions(options map[string]interface{}) (*JenkinsOptions, errors.Error)

func ValidateTaskOptions

func ValidateTaskOptions(op *JenkinsOptions) (*JenkinsOptions, errors.Error)

type JenkinsTaskData

type JenkinsTaskData struct {
	Options       *JenkinsOptions
	ApiClient     *api.ApiAsyncClient
	Connection    *models.JenkinsConnection
	RegexEnricher *api.RegexEnricher
}

type SimpleBuild

type SimpleBuild struct {
	Number   string
	FullName string
}

type SimpleJenkinsApiBuild

type SimpleJenkinsApiBuild struct {
	Number    int64
	Timestamp int64 `json:"timestamp"`
}

type SimpleJob

type SimpleJob struct {
	Name string
	Path string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL