Documentation
¶
Index ¶
- type Artifacts
- type Cache
- type DefaultConfig
- type IDToken
- type ImageConfig
- type Job
- func (j Job) AfterScript() []string
- func (j Job) AllowFailure() bool
- func (j Job) Artifacts() *Artifacts
- func (j Job) BeforeScript() []string
- func (j Job) Cache() *Cache
- func (j Job) HasNeed(name string) bool
- func (j Job) IDTokens() map[string]*IDToken
- func (j Job) Image() *ImageConfig
- func (j Job) MarshalYAML() (any, error)
- func (j Job) Needs() []JobNeed
- func (j Job) ResourceGroup() string
- func (j Job) Rules() []Rule
- func (j Job) Script() []string
- func (j Job) Secrets() map[string]*Secret
- func (j Job) Stage() string
- func (j Job) Tags() []string
- func (j Job) Variables() map[string]string
- func (j Job) When() string
- type JobNeed
- type JobOptions
- type Pipeline
- func (p *Pipeline) Default() *DefaultConfig
- func (p *Pipeline) HasNeed(jobName, dependency string) bool
- func (p *Pipeline) Job(name string) (Job, bool)
- func (p *Pipeline) JobCount() int
- func (p *Pipeline) JobNames() []string
- func (p *Pipeline) Stages() []string
- func (p *Pipeline) ToYAML() ([]byte, error)
- func (p *Pipeline) Variables() map[string]string
- func (p *Pipeline) Workflow() *Workflow
- type PipelineBuilder
- type PipelineOptions
- type Reports
- type Rule
- type Secret
- type VaultEngine
- type VaultSecret
- type Workflow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Artifacts ¶
type Artifacts struct {
Paths []string `yaml:"paths,omitempty"`
ExpireIn string `yaml:"expire_in,omitempty"`
Reports *Reports `yaml:"reports,omitempty"`
Name string `yaml:"name,omitempty"`
Untracked bool `yaml:"untracked,omitempty"`
When string `yaml:"when,omitempty"`
ExposeAs string `yaml:"expose_as,omitempty"`
}
Artifacts represents job artifacts.
type Cache ¶
type Cache struct {
Key string `yaml:"key"`
Paths []string `yaml:"paths"`
Policy string `yaml:"policy,omitempty"`
}
Cache represents GitLab CI cache configuration.
type DefaultConfig ¶
type DefaultConfig struct {
Image *ImageConfig `yaml:"image,omitempty"`
}
DefaultConfig represents default job configuration.
type IDToken ¶
type IDToken struct {
Aud string `yaml:"aud"`
}
IDToken represents GitLab CI OIDC token configuration.
type ImageConfig ¶
type ImageConfig struct {
Name string `yaml:"name,omitempty"`
Entrypoint []string `yaml:"entrypoint,omitempty"`
}
ImageConfig represents GitLab CI image configuration.
func (ImageConfig) MarshalYAML ¶
func (img ImageConfig) MarshalYAML() (any, error)
MarshalYAML emits the short string form when entrypoint is empty.
type Job ¶
type Job struct {
// contains filtered or unexported fields
}
Job represents a GitLab CI job.
func NewJob ¶ added in v0.10.6
func NewJob(opts JobOptions) (Job, error)
func (Job) AfterScript ¶
func (Job) AllowFailure ¶
func (Job) BeforeScript ¶
func (Job) Image ¶
func (j Job) Image() *ImageConfig
func (Job) MarshalYAML ¶ added in v0.10.6
func (Job) ResourceGroup ¶
type JobNeed ¶
type JobNeed struct {
Job string `yaml:"job"`
Optional bool `yaml:"optional,omitempty"`
Artifacts *bool `yaml:"artifacts,omitempty"`
}
JobNeed represents a job dependency.
type JobOptions ¶ added in v0.10.6
type JobOptions struct {
Stage string
Image *ImageConfig
Script []string
BeforeScript []string
AfterScript []string
Variables map[string]string
Needs []JobNeed
Rules []Rule
Artifacts *Artifacts
Cache *Cache
Secrets map[string]*Secret
IDTokens map[string]*IDToken
When string
AllowFailure bool
Tags []string
ResourceGroup string
}
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
Pipeline represents a GitLab CI pipeline.
func EmptyPipeline ¶ added in v0.10.6
func EmptyPipeline() *Pipeline
func (*Pipeline) Default ¶
func (p *Pipeline) Default() *DefaultConfig
type PipelineBuilder ¶ added in v0.10.6
type PipelineBuilder struct {
// contains filtered or unexported fields
}
func NewPipelineBuilder ¶ added in v0.10.6
func NewPipelineBuilder(opts PipelineOptions) *PipelineBuilder
func (*PipelineBuilder) AddJob ¶ added in v0.10.6
func (b *PipelineBuilder) AddJob(name string, job Job) error
func (*PipelineBuilder) Build ¶ added in v0.10.6
func (b *PipelineBuilder) Build() (*Pipeline, error)
type PipelineOptions ¶ added in v0.10.6
type PipelineOptions struct {
Stages []string
Variables map[string]string
Default *DefaultConfig
Workflow *Workflow
}
type Reports ¶
type Reports struct {
Terraform []string `yaml:"terraform,omitempty"`
JUnit []string `yaml:"junit,omitempty"`
Cobertura []string `yaml:"cobertura,omitempty"`
}
Reports represents artifact reports.
type Rule ¶
type Rule struct {
If string `yaml:"if,omitempty"`
When string `yaml:"when,omitempty"`
Changes []string `yaml:"changes,omitempty"`
}
Rule represents a job or workflow rule.
type Secret ¶
type Secret struct {
Vault *VaultSecret `yaml:"vault,omitempty"`
VaultPath string `yaml:"-"`
File bool `yaml:"file,omitempty"`
}
Secret represents GitLab CI secret configuration.
func (Secret) MarshalYAML ¶
MarshalYAML emits the short vault syntax when configured.
type VaultEngine ¶
VaultEngine represents Vault secrets engine configuration.
type VaultSecret ¶
type VaultSecret struct {
Engine *VaultEngine `yaml:"engine,omitempty"`
Path string `yaml:"path,omitempty"`
Field string `yaml:"field,omitempty"`
}
VaultSecret represents a secret from HashiCorp Vault.
type Workflow ¶
type Workflow struct {
// contains filtered or unexported fields
}
Workflow controls when pipelines are created.