Documentation ¶
Overview ¶
Package common provides building blocks applicable to all projects.
Index ¶
- Constants
- type All
- type ArtifactStep
- type Build
- func (build *Build) CompileDockerfile(output *dockerfile.Output) error
- func (build *Build) CompileDockerignore(output *dockerignore.Output) error
- func (build *Build) CompileGitignore(output *gitignore.Output) error
- func (build *Build) CompileMakefile(output *makefile.Output) error
- func (build *Build) CompileRelease(output *release.Output) error
- type BuildxOptions
- type CheckoutStep
- type Conformance
- type CoverageStep
- type Docker
- type GHWorkflow
- type Image
- func (image *Image) CompileDockerfile(output *dockerfile.Output) error
- func (image *Image) CompileDockerignore(output *dockerignore.Output) error
- func (image *Image) CompileDrone(output *drone.Output) error
- func (image *Image) CompileGitHubWorkflow(output *ghworkflow.Output) error
- func (image *Image) CompileMakefile(output *makefile.Output) error
- type InputImage
- type Job
- type LicenseConfig
- type Lint
- type MakeHelp
- type ReKres
- type RegistryLoginStep
- type Release
- type ReleaseStep
- type Repository
- type SOPS
- type Step
- type ToolchainBuilder
Constants ¶
const ImageSourceLabel = "org.opencontainers.image.source"
ImageSourceLabel is a docker image label to specify image source.
const MPLHeader = `` /* 192-byte string literal not displayed */
MPLHeader is the Mozilla Public License 2.0 header.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArtifactStep ¶
type ArtifactStep struct { Type string `yaml:"type"` ArtifactName string `yaml:"artifactName"` ArtifactPath string `yaml:"artifactPath"` AdditionalArtifacts []string `yaml:"additionalArtifacts,omitempty"` DisableExecutableListGeneration bool `yaml:"disableExecutableListGeneration"` }
ArtifactStep defines options for artifact steps.
type Build ¶
type Build struct { dag.BaseNode ArtifactsPath string `yaml:"artifactsPath"` IgnoredPaths []string `yaml:"ignoredPaths"` // contains filtered or unexported fields }
Build provides very common build environment settings.
func (*Build) CompileDockerfile ¶
func (build *Build) CompileDockerfile(output *dockerfile.Output) error
CompileDockerfile implements dockerfile.Compiler.
func (*Build) CompileDockerignore ¶
func (build *Build) CompileDockerignore(output *dockerignore.Output) error
CompileDockerignore implements dockerignore.Compiler.
func (*Build) CompileGitignore ¶
CompileGitignore implements gitignore.Compiler.
func (*Build) CompileMakefile ¶
CompileMakefile implements makefile.Compiler.
type BuildxOptions ¶
BuildxOptions defines options for buildx.
type CheckoutStep ¶
type CheckoutStep struct { Repository string `yaml:"repository"` Ref string `yaml:"ref"` Path string `yaml:"path"` }
CheckoutStep defines options for checkout steps.
type Conformance ¶
type Conformance struct { dag.BaseNode ConformanceImage string `yaml:"conformanceImage"` // contains filtered or unexported fields }
Conformance builds Makefile `conformance` target.
func NewConformance ¶
func NewConformance(meta *meta.Options) *Conformance
NewConformance initializes Conformance.
func (*Conformance) CompileMakefile ¶
func (conformance *Conformance) CompileMakefile(output *makefile.Output) error
CompileMakefile implements makefile.Compiler.
type CoverageStep ¶
type CoverageStep struct {
Files []string `yaml:"files"`
}
CoverageStep defines options for coverage steps.
type Docker ¶
type Docker struct { dag.BaseNode DockerImage string `yaml:"dockerImage"` AllowInsecure bool `yaml:"allowInsecure"` ExtraBuildArgs []string `yaml:"extraBuildArgs"` DockerResourceRequests *yaml.ResourceObject `yaml:"dockerResourceRequests"` // contains filtered or unexported fields }
Docker provides build infrastructure via docker buildx.
func (*Docker) BuildBaseDroneSteps ¶
func (docker *Docker) BuildBaseDroneSteps(output drone.StepService)
BuildBaseDroneSteps builds the base steps which start the pipeline.
func (*Docker) CompileDrone ¶
CompileDrone implements drone.Compiler.
type GHWorkflow ¶
type GHWorkflow struct { dag.BaseNode CustomRunners []string `yaml:"customRunners,omitempty"` Jobs []Job `yaml:"jobs"` // contains filtered or unexported fields }
GHWorkflow is a node that represents the GitHub workflow configuration.
func NewGHWorkflow ¶
func NewGHWorkflow(meta *meta.Options) *GHWorkflow
NewGHWorkflow creates a new GHWorkflow node.
func (*GHWorkflow) CompileGitHubWorkflow ¶
func (gh *GHWorkflow) CompileGitHubWorkflow(o *ghworkflow.Output) error
CompileGitHubWorkflow implements ghworkflow.Compiler.
type Image ¶
type Image struct { dag.BaseNode ExtraEnvironment map[string]string `yaml:"extraEnvironment"` BaseImage string `yaml:"baseImage"` AdditionalImages []string `yaml:"additionalImages"` CopyFrom []struct { Stage string `yaml:"stage"` Source string `yaml:"source"` Destination string `yaml:"destination"` } `yaml:"copyFrom"` DependsOn []string `yaml:"dependsOn"` ImageName string `yaml:"imageName"` Entrypoint string `yaml:"entrypoint"` EntrypointArgs []string `yaml:"entrypointArgs"` CustomCommands []string `yaml:"customCommands"` AllowedLocalPaths []string `yaml:"allowedLocalPaths"` PushLatest bool `yaml:"pushLatest"` // contains filtered or unexported fields }
Image provides common image build target.
func (*Image) CompileDockerfile ¶
func (image *Image) CompileDockerfile(output *dockerfile.Output) error
CompileDockerfile implements dockerfile.Compiler.
func (*Image) CompileDockerignore ¶
func (image *Image) CompileDockerignore(output *dockerignore.Output) error
CompileDockerignore implements dockerignore.Compiler.
func (*Image) CompileDrone ¶
CompileDrone implements drone.Compiler.
func (*Image) CompileGitHubWorkflow ¶
func (image *Image) CompileGitHubWorkflow(output *ghworkflow.Output) error
CompileGitHubWorkflow implements ghworkflow.Compiler.
type InputImage ¶
InputImage provides common input image used to build containers.
func NewCACerts ¶
func NewCACerts(_ *meta.Options) *InputImage
NewCACerts builds standard input image for ca-certificates.
func (*InputImage) CompileDockerfile ¶
func (inputImage *InputImage) CompileDockerfile(output *dockerfile.Output) error
CompileDockerfile implements dockerfile.Compiler.
type Job ¶
type Job struct { Name string `yaml:"name"` BuildxOptions *BuildxOptions `yaml:"buildxOptions,omitempty"` Conditions []string `yaml:"conditions,omitempty"` Crons []string `yaml:"crons,omitempty"` Depends []string `yaml:"depends,omitempty"` Runners []string `yaml:"runners,omitempty"` TriggerLabels []string `yaml:"triggerLabels,omitempty"` Steps []Step `yaml:"steps,omitempty"` SOPS bool `yaml:"sops"` }
Job defines options for jobs.
type LicenseConfig ¶
type LicenseConfig struct { Enabled *bool `yaml:"enabled"` Root string `yaml:"root"` ID string `yaml:"id"` Params map[string]any `yaml:"params"` Header string `yaml:"header"` }
LicenseConfig configures the license.
type Lint ¶
Lint provides common lint target.
func (*Lint) CompileDrone ¶
CompileDrone implements drone.Compiler.
func (*Lint) CompileGitHubWorkflow ¶
func (lint *Lint) CompileGitHubWorkflow(output *ghworkflow.Output) error
CompileGitHubWorkflow implements ghworkflow.Compiler.
type MakeHelp ¶
type MakeHelp struct { dag.BaseNode MenuHeader string `yaml:"menuHeader"` // contains filtered or unexported fields }
MakeHelp provides Makefile `help` target.
type ReKres ¶
type ReKres struct { dag.BaseNode KresImage string `yaml:"kresImage"` // contains filtered or unexported fields }
ReKres builds Makefile `rekres` target.
type RegistryLoginStep ¶
type RegistryLoginStep struct {
Registry string `yaml:"registry"`
}
RegistryLoginStep defines options for registry login steps.
type Release ¶
type Release struct { dag.BaseNode // List of file patterns relative to the ArtifactsPath to include in the release. // // If not specified, defaults to the auto-detected commands. Artifacts []string `yaml:"artifacts"` // contains filtered or unexported fields }
Release provides common release target.
func (*Release) CompileDrone ¶
CompileDrone implements drone.Compiler.
func (*Release) CompileGitHubWorkflow ¶
func (release *Release) CompileGitHubWorkflow(output *ghworkflow.Output) error
CompileGitHubWorkflow implements ghworkflow.Compiler.
type ReleaseStep ¶
type ReleaseStep struct { BaseDirectory string `yaml:"baseDirectory"` ReleaseNotes string `yaml:"releaseNotes"` Artifacts []string `yaml:"artifacts"` GenerateChecksums bool `yaml:"generateChecksums"` }
ReleaseStep defines options for release steps.
type Repository ¶
type Repository struct { dag.BaseNode MainBranch string `yaml:"mainBranch"` EnforceContexts []string `yaml:"enforceContexts"` EnableConform bool `yaml:"enableConform"` ConformWebhookURL string `yaml:"conformWebhookURL"` ConformTypes []string `yaml:"conformTypes"` ConformScopes []string `yaml:"conformScopes"` ConformLicenseCheck bool `yaml:"conformLicenseCheck"` ConformGPGSignatureCheck bool `yaml:"conformGPGSignatureCheck"` ConformMaximumOfOneCommit bool `yaml:"conformMaximumOfOneCommit"` DeprecatedEnableLicense *bool `yaml:"enableLicense"` DeprecatedLicense *LicenseConfig `yaml:"license"` Licenses []LicenseConfig `yaml:"licenses"` LicenseChecks []licensepolicy.Spec `yaml:"licenseChecks"` BotName string `yaml:"botName"` // contains filtered or unexported fields }
Repository sets up repository settings.
func NewRepository ¶
func NewRepository(meta *meta.Options) *Repository
NewRepository initializes Repository.
func (*Repository) AfterLoad ¶
func (r *Repository) AfterLoad() error
AfterLoad maps back main branch override to meta.
func (*Repository) CompileConform ¶
func (r *Repository) CompileConform(o *conform.Output) error
CompileConform implements conform.Compiler.
func (*Repository) CompileGitHub ¶
func (r *Repository) CompileGitHub(client *github.Client) error
CompileGitHub implements github.Compiler.
func (*Repository) CompileLicense ¶
func (r *Repository) CompileLicense(o *license.Output) error
CompileLicense implements license.Compiler.
type SOPS ¶
type SOPS struct { dag.BaseNode Config string `yaml:"config"` Enabled bool `yaml:"enabled"` // contains filtered or unexported fields }
SOPS is a node that represents the sops configuration.
func (*SOPS) CompileGitHubWorkflow ¶
func (sops *SOPS) CompileGitHubWorkflow(o *ghworkflow.Output) error
CompileGitHubWorkflow implements ghworkflow.Compiler.
type Step ¶
type Step struct { Name string `yaml:"name"` Command string `yaml:"command"` NonMakeStep bool `yaml:"nonMakeStep,omitempty"` ArtifactStep *ArtifactStep `yaml:"artifactStep,omitempty"` CheckoutStep *CheckoutStep `yaml:"checkoutStep,omitempty"` CoverageStep *CoverageStep `yaml:"coverageStep,omitempty"` TerraformStep bool `yaml:"terraformStep,omitempty"` RegistryLoginStep *RegistryLoginStep `yaml:"registryLoginStep,omitempty"` ReleaseStep *ReleaseStep `yaml:"releaseStep,omitempty"` WithSudo bool `yaml:"withSudo,omitempty"` Arguments []string `yaml:"arguments,omitempty"` Environment map[string]string `yaml:"environment"` TimeoutMinutes int `yaml:"timeoutMinutes,omitempty"` ContinueOnError bool `yaml:"continueOnError,omitempty"` Conditions []string `yaml:"conditions,omitempty"` }
Step defines options for steps.
type ToolchainBuilder ¶
type ToolchainBuilder interface {
ToolchainBuild(*dockerfile.Stage) error
}
ToolchainBuilder is implemented by nodes which wish to inject into the toolchain build.