Documentation
¶
Index ¶
- type ArtifactReports
- type ArtifactsConfig
- type CfgSecret
- type CfgVaultSecret
- type Config
- type IDToken
- type Image
- type JobConfig
- type JobDefaults
- func (j *JobDefaults) GetAfterScript() []string
- func (j *JobDefaults) GetArtifacts() *ArtifactsConfig
- func (j *JobDefaults) GetBeforeScript() []string
- func (j *JobDefaults) GetIDTokens() map[string]IDToken
- func (j *JobDefaults) GetImage() *Image
- func (j *JobDefaults) GetRules() []Rule
- func (j *JobDefaults) GetSecrets() map[string]CfgSecret
- func (j *JobDefaults) GetTags() []string
- func (j *JobDefaults) GetVariables() map[string]string
- type JobOverwrite
- func (j *JobOverwrite) GetAfterScript() []string
- func (j *JobOverwrite) GetArtifacts() *ArtifactsConfig
- func (j *JobOverwrite) GetBeforeScript() []string
- func (j *JobOverwrite) GetIDTokens() map[string]IDToken
- func (j *JobOverwrite) GetImage() *Image
- func (j *JobOverwrite) GetRules() []Rule
- func (j *JobOverwrite) GetSecrets() map[string]CfgSecret
- func (j *JobOverwrite) GetTags() []string
- func (j *JobOverwrite) GetVariables() map[string]string
- type JobOverwriteType
- type MRCommentConfig
- type MRConfig
- type Rule
- type SummaryJobConfig
- type VaultEngine
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArtifactReports ¶
type ArtifactReports struct {
Terraform []string `yaml:"terraform,omitempty" json:"terraform,omitempty" jsonschema:"description=Terraform report paths"`
JUnit []string `yaml:"junit,omitempty" json:"junit,omitempty" jsonschema:"description=JUnit report paths"`
Cobertura []string `yaml:"cobertura,omitempty" json:"cobertura,omitempty" jsonschema:"description=Cobertura coverage report paths"`
}
ArtifactReports defines artifact reports configuration.
type ArtifactsConfig ¶
type ArtifactsConfig struct {
Paths []string `yaml:"paths,omitempty" json:"paths,omitempty" jsonschema:"description=File/directory paths to include as artifacts"`
ExpireIn string `` /* 132-byte string literal not displayed */
Reports *ArtifactReports `yaml:"reports,omitempty" json:"reports,omitempty" jsonschema:"description=Artifact reports configuration"`
Name string `yaml:"name,omitempty" json:"name,omitempty" jsonschema:"description=Artifact archive name"`
Untracked bool `yaml:"untracked,omitempty" json:"untracked,omitempty" jsonschema:"description=Include all untracked files"`
When string `` /* 137-byte string literal not displayed */
ExposeAs string `yaml:"expose_as,omitempty" json:"expose_as,omitempty" jsonschema:"description=Makes artifacts available in MR UI"`
}
ArtifactsConfig defines GitLab CI artifacts configuration.
type CfgSecret ¶
type CfgSecret struct {
Vault *CfgVaultSecret `yaml:"vault,omitempty" json:"vault,omitempty" jsonschema:"description=HashiCorp Vault secret configuration"`
File bool `yaml:"file,omitempty" json:"file,omitempty" jsonschema:"description=Write secret to a file"`
}
CfgSecret defines a CI/CD secret in the config file.
type CfgVaultSecret ¶
type CfgVaultSecret struct {
Engine *VaultEngine `yaml:"engine,omitempty" json:"engine,omitempty" jsonschema:"description=Vault secrets engine configuration"`
Path string `yaml:"path,omitempty" json:"path,omitempty" jsonschema:"description=Path to the secret in Vault"`
Field string `yaml:"field,omitempty" json:"field,omitempty" jsonschema:"description=Field to extract from the secret"`
Shorthand string `yaml:"-" jsonschema:"-"`
}
CfgVaultSecret defines a secret from HashiCorp Vault in the config file.
func (*CfgVaultSecret) UnmarshalYAML ¶
func (v *CfgVaultSecret) UnmarshalYAML(unmarshal func(any) error) error
UnmarshalYAML supports both shorthand and full object syntax.
type Config ¶
type Config struct {
TerraformBinary string `` /* 148-byte string literal not displayed */
Image Image `yaml:"image" json:"image" jsonschema:"description=Docker image for terraform jobs,default=hashicorp/terraform:1.6"`
StagesPrefix string `` /* 160-byte string literal not displayed */
Parallelism int `yaml:"parallelism" json:"parallelism" jsonschema:"description=Maximum parallel jobs per stage,minimum=1,default=5"`
Variables map[string]string `yaml:"variables,omitempty" json:"variables,omitempty" jsonschema:"description=Global pipeline variables"`
PlanEnabled bool `yaml:"plan_enabled" json:"plan_enabled" jsonschema:"description=Enable terraform plan stage,default=true"`
PlanOnly bool `yaml:"plan_only" json:"plan_only" jsonschema:"description=Generate only plan jobs (no apply jobs),default=false"`
AutoApprove bool `` /* 126-byte string literal not displayed */
CacheEnabled bool `yaml:"cache_enabled" json:"cache_enabled" jsonschema:"description=Enable caching of .terraform directory,default=true"`
InitEnabled bool `` /* 139-byte string literal not displayed */
Rules []Rule `yaml:"rules,omitempty" json:"rules,omitempty" jsonschema:"description=Workflow rules for conditional pipeline execution"`
JobDefaults *JobDefaults `yaml:"job_defaults,omitempty" json:"job_defaults,omitempty" jsonschema:"description=Default settings applied to all jobs"`
Overwrites []JobOverwrite `yaml:"overwrites,omitempty" json:"overwrites,omitempty" jsonschema:"description=Job-level overrides for plan or apply jobs"`
MR *MRConfig `yaml:"mr,omitempty" json:"mr,omitempty" jsonschema:"description=Merge request integration settings"`
}
Config contains GitLab CI specific settings.
type IDToken ¶
type IDToken struct {
Aud string `yaml:"aud" json:"aud"`
}
IDToken represents configured OIDC token settings.
type JobConfig ¶
type JobConfig interface {
GetImage() *Image
GetIDTokens() map[string]IDToken
GetSecrets() map[string]CfgSecret
GetBeforeScript() []string
GetAfterScript() []string
GetArtifacts() *ArtifactsConfig
GetTags() []string
GetRules() []Rule
GetVariables() map[string]string
}
JobConfig is a shared read-only view over job defaults and overwrites.
type JobDefaults ¶
type JobDefaults struct {
Image *Image `yaml:"image,omitempty" json:"image,omitempty" jsonschema:"description=Docker image override for all jobs"`
IDTokens map[string]IDToken `yaml:"id_tokens,omitempty" json:"id_tokens,omitempty" jsonschema:"description=OIDC tokens for cloud provider authentication"`
Secrets map[string]CfgSecret `yaml:"secrets,omitempty" json:"secrets,omitempty" jsonschema:"description=Secrets from external secret managers"`
BeforeScript []string `yaml:"before_script,omitempty" json:"before_script,omitempty" jsonschema:"description=Commands to run before each job"`
AfterScript []string `yaml:"after_script,omitempty" json:"after_script,omitempty" jsonschema:"description=Commands to run after each job"`
Artifacts *ArtifactsConfig `yaml:"artifacts,omitempty" json:"artifacts,omitempty" jsonschema:"description=GitLab CI artifacts configuration"`
Tags []string `yaml:"tags,omitempty" json:"tags,omitempty" jsonschema:"description=GitLab runner tags"`
Rules []Rule `yaml:"rules,omitempty" json:"rules,omitempty" jsonschema:"description=Job-level rules"`
Variables map[string]string `yaml:"variables,omitempty" json:"variables,omitempty" jsonschema:"description=Additional variables"`
}
JobDefaults defines default settings for all generated jobs.
func (*JobDefaults) GetAfterScript ¶
func (j *JobDefaults) GetAfterScript() []string
func (*JobDefaults) GetArtifacts ¶
func (j *JobDefaults) GetArtifacts() *ArtifactsConfig
func (*JobDefaults) GetBeforeScript ¶
func (j *JobDefaults) GetBeforeScript() []string
func (*JobDefaults) GetIDTokens ¶
func (j *JobDefaults) GetIDTokens() map[string]IDToken
func (*JobDefaults) GetImage ¶
func (j *JobDefaults) GetImage() *Image
func (*JobDefaults) GetRules ¶
func (j *JobDefaults) GetRules() []Rule
func (*JobDefaults) GetSecrets ¶
func (j *JobDefaults) GetSecrets() map[string]CfgSecret
func (*JobDefaults) GetTags ¶
func (j *JobDefaults) GetTags() []string
func (*JobDefaults) GetVariables ¶
func (j *JobDefaults) GetVariables() map[string]string
type JobOverwrite ¶
type JobOverwrite struct {
Type JobOverwriteType `yaml:"type" json:"type" jsonschema:"description=Type of jobs to override (plan\\, apply\\, or contributed job name),required"`
Image *Image `yaml:"image,omitempty" json:"image,omitempty" jsonschema:"description=Docker image override for matching jobs"`
IDTokens map[string]IDToken `yaml:"id_tokens,omitempty" json:"id_tokens,omitempty" jsonschema:"description=OIDC tokens for matching jobs"`
Secrets map[string]CfgSecret `yaml:"secrets,omitempty" json:"secrets,omitempty" jsonschema:"description=Secrets for matching jobs"`
BeforeScript []string `yaml:"before_script,omitempty" json:"before_script,omitempty" jsonschema:"description=Commands to run before matching jobs"`
AfterScript []string `yaml:"after_script,omitempty" json:"after_script,omitempty" jsonschema:"description=Commands to run after matching jobs"`
Artifacts *ArtifactsConfig `yaml:"artifacts,omitempty" json:"artifacts,omitempty" jsonschema:"description=Artifacts configuration for matching jobs"`
Tags []string `yaml:"tags,omitempty" json:"tags,omitempty" jsonschema:"description=Runner tags for matching jobs"`
Rules []Rule `yaml:"rules,omitempty" json:"rules,omitempty" jsonschema:"description=Job-level rules for matching jobs"`
Variables map[string]string `yaml:"variables,omitempty" json:"variables,omitempty" jsonschema:"description=Variables for matching jobs"`
}
JobOverwrite defines job-level overrides for plan or apply jobs.
func (*JobOverwrite) GetAfterScript ¶
func (j *JobOverwrite) GetAfterScript() []string
func (*JobOverwrite) GetArtifacts ¶
func (j *JobOverwrite) GetArtifacts() *ArtifactsConfig
func (*JobOverwrite) GetBeforeScript ¶
func (j *JobOverwrite) GetBeforeScript() []string
func (*JobOverwrite) GetIDTokens ¶
func (j *JobOverwrite) GetIDTokens() map[string]IDToken
func (*JobOverwrite) GetImage ¶
func (j *JobOverwrite) GetImage() *Image
func (*JobOverwrite) GetRules ¶
func (j *JobOverwrite) GetRules() []Rule
func (*JobOverwrite) GetSecrets ¶
func (j *JobOverwrite) GetSecrets() map[string]CfgSecret
func (*JobOverwrite) GetTags ¶
func (j *JobOverwrite) GetTags() []string
func (*JobOverwrite) GetVariables ¶
func (j *JobOverwrite) GetVariables() map[string]string
type JobOverwriteType ¶
type JobOverwriteType string
JobOverwriteType defines the type of jobs to override.
const ( OverwriteTypePlan JobOverwriteType = "plan" OverwriteTypeApply JobOverwriteType = "apply" )
type MRCommentConfig ¶
type MRCommentConfig = ci.MRCommentConfig
type MRConfig ¶
type MRConfig struct {
Comment *MRCommentConfig `yaml:"comment,omitempty" json:"comment,omitempty" jsonschema:"description=MR comment configuration"`
Labels []string `` /* 168-byte string literal not displayed */
SummaryJob *SummaryJobConfig `yaml:"summary_job,omitempty" json:"summary_job,omitempty" jsonschema:"description=Summary job configuration"`
}
MRConfig contains settings for MR integration.
type Rule ¶
type Rule struct {
If string `yaml:"if,omitempty" json:"if,omitempty"`
When string `yaml:"when,omitempty" json:"when,omitempty"`
Changes []string `yaml:"changes,omitempty" json:"changes,omitempty"`
}
Rule represents workflow or job rules from config input.
type SummaryJobConfig ¶
type SummaryJobConfig struct {
Image *Image `yaml:"image,omitempty" json:"image,omitempty" jsonschema:"description=Docker image for summary job (must contain terraci)"`
Tags []string `yaml:"tags,omitempty" json:"tags,omitempty" jsonschema:"description=Runner tags for summary job"`
}
SummaryJobConfig contains settings for the summary job.
type VaultEngine ¶
type VaultEngine struct {
Name string `yaml:"name" json:"name"`
Path string `yaml:"path" json:"path"`
}
VaultEngine represents configured Vault engine settings.