zuulcf

package
v0.0.37 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package zuulcf contains a library to build Zuul configurations.

Index

Constants

View Source
const (
	// This is needed due to https://go.dev/ref/spec#The_zero_value
	// Zero Values for int's will not show while printing the structure
	GerritVotePointTwo      = 2
	GerritVotePointOne      = 1
	GerritVotePointZero     = 0
	GerritVotePointMinusOne = -1
	GerritVotePointMinusTwo = -2
)

Variables

View Source
var TenantTemplate = `` /* 305-byte string literal not displayed */

Functions

func GenerateZuulTemplateFile

func GenerateZuulTemplateFile(tenant TenantTemplateStruct) (string, error)

Types

type AnsiblePlay

type AnsiblePlay struct {
	Hosts string           `yaml:"hosts"`
	Roles []map[string]any `yaml:"roles,omitempty"`
	Vars  []map[string]any `yaml:"vars,omitempty"`
	Tasks []map[string]any `yaml:"tasks,omitempty"`
}

type AnsiblePlayBook

type AnsiblePlayBook []AnsiblePlay

type GerritCodeReview

type GerritCodeReview GerritVotePoint

func GetGerritCodeReviewValue

func GetGerritCodeReviewValue(value string) GerritCodeReview

type GerritReporterMap

type GerritReporterMap map[string]PipelineGerritReporter

type GerritVotePoint

type GerritVotePoint int8

func GetZuulPipelineReporterVerified

func GetZuulPipelineReporterVerified(verified string) GerritVotePoint

type GerritWorkflow

type GerritWorkflow GerritVotePoint

func GetGerritWorkflowValue

func GetGerritWorkflowValue(value string) GerritWorkflow

type GitGLMergeRequests

type GitGLMergeRequests string
const (
	Opened     GitGLMergeRequests = "opened"
	Changed    GitGLMergeRequests = "changed"
	Merged     GitGLMergeRequests = "merged"
	Comment    GitGLMergeRequests = "comment"
	Approved   GitGLMergeRequests = "approved"
	Unapproved GitGLMergeRequests = "unapproved"
	Labeled    GitGLMergeRequests = "labeled"
)

type GitLabReporterMap

type GitLabReporterMap map[string]PipelineGitLabReporter

type Job

type Job struct {
	Job JobBody `yaml:"job"`
}

type JobBody

type JobBody struct {
	Name        string                   `yaml:"name"`
	Description string                   `yaml:"description,omitempty"`
	ExtraVars   map[string]interface{}   `yaml:"extra-vars,omitempty"`
	Parent      *string                  `yaml:"parent"`
	PostRun     []string                 `yaml:"post-run,omitempty"`
	PreRun      []string                 `yaml:"pre-run,omitempty"`
	Roles       []JobRoles               `yaml:"roles,omitempty"`
	Secrets     []interface{}            `yaml:"secrets,omitempty"`
	Timeout     uint16                   `yaml:"timeout,omitempty"`
	Attempts    uint8                    `yaml:"attempts,omitempty"`
	Final       bool                     `yaml:"final,omitempty"`
	Run         []interface{}            `yaml:"run,omitempty"`
	NodeSet     NodeSetBody              `yaml:"nodeset,omitempty"`
	Semaphores  []JobRunNameAndSemaphore `yaml:"semaphores,omitempty"`
}

type JobConfig

type JobConfig []Job

type JobRoles

type JobRoles map[string]string

type JobRunName

type JobRunName struct {
	Name string `yaml:",inline"`
}

type JobRunNameAndSemaphore

type JobRunNameAndSemaphore struct {
	Name      string `yaml:"name"`
	Semaphore string `yaml:"semaphore,omitempty"`
}

type JobSecrets

type JobSecrets struct {
	Name         string `yaml:"name"`
	Secret       string `yaml:"secret"`
	PassToParent bool   `yaml:"pass-to-parent,omitempty"`
}

type NodeSet

type NodeSet struct {
	NodeSet NodeSetBody `yaml:"nodeset"`
}

type NodeSetBody

type NodeSetBody struct {
	Name         string                  `yaml:"name,omitempty"`
	Nodes        []NodeSetNodesBody      `yaml:"nodes,omitempty"`
	Groups       []NodeSetNodesGroupBody `yaml:"groups,omitempty"`
	Alternatives []NodesSetAlternatives  `yaml:"alternatives,omitempty"`
}

type NodeSetNodesBody

type NodeSetNodesBody struct {
	Name  string `yaml:"name"`
	Label string `yaml:"label"`
}

type NodeSetNodesGroupBody

type NodeSetNodesGroupBody struct {
	Name  string `yaml:"name"`
	Label string `yaml:"label"`
}

type NodeSets

type NodeSets []NodeSet

type NodesSetAlternatives

type NodesSetAlternatives string

type Pipeline

type Pipeline struct {
	Pipeline PipelineBody `yaml:"pipeline"`
}

type PipelineBody

type PipelineBody struct {
	Name                 string                 `yaml:"name"`
	Description          string                 `yaml:"description,omitempty"`
	Manager              PipelineManager        `yaml:"manager"`
	PostReview           bool                   `yaml:"post-review,omitempty"`
	Precedence           PipelinePrecedence     `yaml:"precedence,omitempty"`
	Supercedes           []string               `yaml:"supercedes,omitempty"`
	SuccessMessage       string                 `yaml:"success-message,omitempty"`
	FailureMessage       string                 `yaml:"failure-message,omitempty"`
	Require              PipelineRequire        `yaml:"require,omitempty"`
	Start                PipelineReporter       `yaml:"start,omitempty"`
	Success              PipelineReporter       `yaml:"success,omitempty"`
	Failure              PipelineReporter       `yaml:"failure,omitempty"`
	Trigger              PipelineGenericTrigger `yaml:"trigger,omitempty"`
	WindowFloor          uint8                  `yaml:"window-floor,omitempty"`
	WindowIncreaseFactor uint8                  `yaml:"window-increase-factor,omitempty"`
}

type PipelineConfig

type PipelineConfig []Pipeline

type PipelineDriverReporter

type PipelineDriverReporter struct {
	Gitlab *PipelineGitLabReporter `yaml:",inline,omitempty"`
	Gerrit *PipelineGerritReporter `yaml:",inline,omitempty"`
}

type PipelineGenericTrigger

type PipelineGenericTrigger map[string]PipelineTriggerArray

func GetTriggerCheckByDriver

func GetTriggerCheckByDriver(driver string, connection string) (PipelineGenericTrigger, error)

func GetTriggerGateByDriver

func GetTriggerGateByDriver(driver string, connection string) (PipelineGenericTrigger, error)

func GetTriggerPostByDriver

func GetTriggerPostByDriver(driver string, connection string) (PipelineGenericTrigger, error)

type PipelineGerritReporter

type PipelineGerritReporter struct {
	Submit   bool            `yaml:"submit,omitempty"`
	Verified GerritVotePoint `yaml:"Verified"`
}

type PipelineGerritRequirement

type PipelineGerritRequirement struct {
	Username        string                          `yaml:"username,omitempty"`
	CurrentPatchset bool                            `yaml:"current-patchset,omitempty"`
	Verified        []GerritVotePoint               `yaml:"Verified,omitempty,flow"`
	GerritApproval  []PipelineRequireGerritApproval `yaml:"approval,omitempty"`
	Workflow        GerritWorkflow                  `yaml:"Workflow,omitempty"`
}

type PipelineGitLabReporter

type PipelineGitLabReporter struct {
	Comment  bool     `yaml:"comment"`
	Approval bool     `yaml:"approval"`
	Merge    bool     `yaml:"merge,omitempty"`
	Labels   []string `yaml:"labels,omitempty"`
	Unlabels []string `yaml:"unlabels,omitempty"`
}

type PipelineGitLabRequirement

type PipelineGitLabRequirement struct {
	Merged   bool     `yaml:"merged,omitempty"`
	Approved bool     `yaml:"approved,omitempty"`
	Labels   []string `yaml:"labels,omitempty"`
}

type PipelineManager

type PipelineManager string
const (
	Dependent   PipelineManager = "dependent"
	Independent PipelineManager = "independent"
	Serial      PipelineManager = "serial"
	Supercedent PipelineManager = "supercedent"
)

func GetZuulPipelineManager

func GetZuulPipelineManager(manager string) PipelineManager

type PipelinePrecedence

type PipelinePrecedence string
const (
	High   PipelinePrecedence = "high"
	Low    PipelinePrecedence = "low"
	Normal PipelinePrecedence = "normal"
)

func GetZuulPipelinePrecedence

func GetZuulPipelinePrecedence(precedence string) PipelinePrecedence

type PipelineReporter

type PipelineReporter struct {
	Reporter    ReporterMap `yaml:",inline"`
	SQLReporter []string    `yaml:"sqlreporter,omitempty"`
}

func GetReportersCheckByDriver

func GetReportersCheckByDriver(driver string, connection string) ([]PipelineReporter, error)

func GetReportersGateByDriver

func GetReportersGateByDriver(driver string, connection string) ([]PipelineReporter, error)

type PipelineRequire

type PipelineRequire map[string]PipelineRequireApproval

func GetRequireCheckByDriver

func GetRequireCheckByDriver(driver string, connection string) (PipelineRequire, error)

func GetRequireGateByDriver

func GetRequireGateByDriver(driver string, connection string) (PipelineRequire, error)

type PipelineRequireApproval

type PipelineRequireApproval struct {
	Open   bool                      `yaml:"open,omitempty"`
	Gerrit PipelineGerritRequirement `yaml:",inline,omitempty"`
	Gitlab PipelineGitLabRequirement `yaml:",inline,omitempty"`
}

type PipelineRequireGerritApproval

type PipelineRequireGerritApproval struct {
	Workflow   GerritWorkflow   `yaml:"Workflow,omitempty"`
	Verified   GerritVotePoint  `yaml:"Verified,omitempty,flow"`
	CodeReview GerritCodeReview `yaml:"Code-Review,omitempty"`
}

type PipelineTrigger

type PipelineTrigger struct {
	Event         string                `yaml:"event"`
	Comment       string                `yaml:"comment,omitempty"`
	Ref           []string              `yaml:"ref,omitempty"`
	GitTrigger    PipelineTriggerGit    `yaml:",inline"`
	GitLabTrigger PipelineTriggerGitLab `yaml:",inline"`
}

type PipelineTriggerArray

type PipelineTriggerArray []PipelineTrigger

type PipelineTriggerGit

type PipelineTriggerGit struct {
	Gerrit   PipelineTriggerGitGerrit        `yaml:"require,omitempty"`
	Approval []PipelineRequireGerritApproval `yaml:"approval,omitempty"`
	Username string                          `yaml:"username,omitempty"`
}

type PipelineTriggerGitGerrit

type PipelineTriggerGitGerrit struct {
	Approval []PipelineRequireApproval `yaml:"approval,omitempty"`
}

type PipelineTriggerGitLab

type PipelineTriggerGitLab struct {
	Action   []GitGLMergeRequests `yaml:"action,omitempty"`
	Labels   []string             `yaml:"labels,omitempty"`
	Unlabels []string             `yaml:"unlabels,omitempty"`
}

type Project

type Project struct {
	Project ZuulProjectBody `yaml:"project"`
}

type ProjectConfig

type ProjectConfig []Project

type ReporterMap

type ReporterMap map[string]PipelineDriverReporter

type Semaphore

type Semaphore struct {
	Semaphore SemaphoreBody `yaml:"semaphore"`
}

type SemaphoreBody

type SemaphoreBody struct {
	Name string `yaml:"name"`
	Max  int8   `yaml:"max,omitempty"`
}

type Semaphores

type Semaphores []Semaphore

type Tenant

type Tenant struct {
	Tenant TenantBody `yaml:"tenant"`
}

type TenantBody

type TenantBody struct {
	Name   string                 `yaml:"name"`
	Source TenantConnectionSource `yaml:"source,omitempty"`
}

type TenantConfig

type TenantConfig []Tenant

type TenantConnProjects

type TenantConnProjects struct {
	ConfigProjects    []string `yaml:"config-projects"`
	UntrustedProjects []string `yaml:"untrusted-projects"`
}

type TenantConnectionSource

type TenantConnectionSource map[string]TenantConnProjects

type TenantTemplateStruct

type TenantTemplateStruct struct {
	Name      string
	Source    string
	Trusted   []string
	Untrusted []string
}

type ZuulProjectBody

type ZuulProjectBody struct {
	Name          string                 `yaml:"name,omitempty"`
	Templates     []string               `yaml:"templates,omitempty"`
	DefaultBranch string                 `yaml:"default-branch,omitempty"`
	MergeMode     ZuulProjectMergeMode   `yaml:"merge-mode,omitempty"`
	Vars          map[string]interface{} `yaml:"vars,omitempty"`
	Queue         string                 `yaml:"queue,omitempty"`
	Pipeline      ZuulProjectPipelineMap `yaml:",inline"`
}

type ZuulProjectMergeMode

type ZuulProjectMergeMode string
const (
	Merge        ZuulProjectMergeMode = "merge"
	MergeResolve ZuulProjectMergeMode = "merge-resolve"
	CherryPick   ZuulProjectMergeMode = "cherry-pick"
	SquashMerge  ZuulProjectMergeMode = "squash-merge"
	Rebase       ZuulProjectMergeMode = "rebase"
	Empty        ZuulProjectMergeMode = ""
)

func GetZuulProjectMergeMode

func GetZuulProjectMergeMode(mergemode string) ZuulProjectMergeMode

type ZuulProjectPipeline

type ZuulProjectPipeline struct {
	Jobs     []string `yaml:"jobs,omitempty"`
	Debug    bool     `yaml:"debug,omitempty"`
	FailFast bool     `yaml:"fail-fast,omitempty"`
}

type ZuulProjectPipelineMap

type ZuulProjectPipelineMap map[string]ZuulProjectPipeline

Jump to

Keyboard shortcuts

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