common

package
v0.0.0-...-f292767 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: MPL-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package common provides building blocks applicable to all projects.

Index

Constants

View Source
const ImageSourceLabel = "org.opencontainers.image.source"

ImageSourceLabel is a docker image label to specify image source.

View 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 All

type All struct {
	dag.BaseNode
	// contains filtered or unexported fields
}

All builds Makefile `all` target.

func NewAll

func NewAll(meta *meta.Options) *All

NewAll initializes All.

func (*All) CompileMakefile

func (all *All) CompileMakefile(output *makefile.Output) error

CompileMakefile implements makefile.Compiler.

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 NewBuild

func NewBuild(meta *meta.Options) *Build

NewBuild initializes Build.

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

func (build *Build) CompileGitignore(output *gitignore.Output) error

CompileGitignore implements gitignore.Compiler.

func (*Build) CompileMakefile

func (build *Build) CompileMakefile(output *makefile.Output) error

CompileMakefile implements makefile.Compiler.

func (*Build) CompileRelease

func (build *Build) CompileRelease(output *release.Output) error

CompileRelease implements release.Compiler.

type BuildxOptions

type BuildxOptions struct {
	Enabled      bool `yaml:"enabled"`
	CrossBuilder bool `yaml:"crossBuilder"`
}

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 NewDocker

func NewDocker(meta *meta.Options) *Docker

NewDocker initializes Docker.

func (*Docker) BuildBaseDroneSteps

func (docker *Docker) BuildBaseDroneSteps(output drone.StepService)

BuildBaseDroneSteps builds the base steps which start the pipeline.

func (*Docker) CompileDrone

func (docker *Docker) CompileDrone(output *drone.Output) error

CompileDrone implements drone.Compiler.

func (*Docker) CompileMakefile

func (docker *Docker) CompileMakefile(output *makefile.Output) error

CompileMakefile implements makefile.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 NewImage

func NewImage(meta *meta.Options, name string) *Image

NewImage initializes Image.

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

func (image *Image) CompileDrone(output *drone.Output) error

CompileDrone implements drone.Compiler.

func (*Image) CompileGitHubWorkflow

func (image *Image) CompileGitHubWorkflow(output *ghworkflow.Output) error

CompileGitHubWorkflow implements ghworkflow.Compiler.

func (*Image) CompileMakefile

func (image *Image) CompileMakefile(output *makefile.Output) error

CompileMakefile implements makefile.Compiler.

type InputImage

type InputImage struct {
	dag.BaseNode

	Image   string
	Version string
}

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 NewFHS

func NewFHS(*meta.Options) *InputImage

NewFHS builds standard input image for FHS.

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

type Lint struct {
	dag.BaseNode
	// contains filtered or unexported fields
}

Lint provides common lint target.

func NewLint

func NewLint(meta *meta.Options) *Lint

NewLint initializes Lint.

func (*Lint) CompileDrone

func (lint *Lint) CompileDrone(output *drone.Output) error

CompileDrone implements drone.Compiler.

func (*Lint) CompileGitHubWorkflow

func (lint *Lint) CompileGitHubWorkflow(output *ghworkflow.Output) error

CompileGitHubWorkflow implements ghworkflow.Compiler.

func (*Lint) CompileMakefile

func (lint *Lint) CompileMakefile(output *makefile.Output) error

CompileMakefile implements makefile.Compiler.

type MakeHelp

type MakeHelp struct {
	dag.BaseNode

	MenuHeader string `yaml:"menuHeader"`
	// contains filtered or unexported fields
}

MakeHelp provides Makefile `help` target.

func NewMakeHelp

func NewMakeHelp(meta *meta.Options) *MakeHelp

NewMakeHelp initializes Build.

func (*MakeHelp) CompileMakefile

func (help *MakeHelp) CompileMakefile(output *makefile.Output) error

CompileMakefile implements makefile.Compiler.

type ReKres

type ReKres struct {
	dag.BaseNode

	KresImage string `yaml:"kresImage"`
	// contains filtered or unexported fields
}

ReKres builds Makefile `rekres` target.

func NewReKres

func NewReKres(meta *meta.Options) *ReKres

NewReKres initializes ReKres.

func (*ReKres) CompileMakefile

func (rekres *ReKres) CompileMakefile(output *makefile.Output) error

CompileMakefile implements makefile.Compiler.

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 NewRelease

func NewRelease(m *meta.Options) *Release

NewRelease initializes Release.

func (*Release) CompileDrone

func (release *Release) CompileDrone(output *drone.Output) error

CompileDrone implements drone.Compiler.

func (*Release) CompileGitHubWorkflow

func (release *Release) CompileGitHubWorkflow(output *ghworkflow.Output) error

CompileGitHubWorkflow implements ghworkflow.Compiler.

func (*Release) CompileMakefile

func (release *Release) CompileMakefile(output *makefile.Output) error

CompileMakefile implements makefile.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 NewSOPS

func NewSOPS(meta *meta.Options) *SOPS

NewSOPS creates a new SOPS node.

func (*SOPS) CompileGitHubWorkflow

func (sops *SOPS) CompileGitHubWorkflow(o *ghworkflow.Output) error

CompileGitHubWorkflow implements ghworkflow.Compiler.

func (*SOPS) CompileSops

func (sops *SOPS) CompileSops(o *sops.Output) error

CompileSops implements sops.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.

Jump to

Keyboard shortcuts

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