Documentation ¶
Index ¶
Constants ¶
View Source
const ( BuilderID = "MatterBuild/v0.1" ConfigFileName = "matterbuild.yaml" )
View Source
const ( ProvenanceFilename = "provenance.json" DotEnvFilename = "build.env" SBOMFileName = "sbom.spdx" )
Variables ¶
View Source
var ( RUNSUCCESS = true RUNFAIL = false )
View Source
var DefaultOptions = &Options{ Workdir: ".", Artifacts: ArtifactsConfig{ Files: []string{}, Images: []string{}, }, EnvVars: map[string]string{}, }
View Source
var DefaultRunOptions = &RunOptions{}
Functions ¶
This section is empty.
Types ¶
type ArtifactsConfig ¶
type Build ¶
type Build struct { Runs []*Run Replacements []replacement.Replacement // contains filtered or unexported fields }
func NewFromAttestation ¶
NewFromAttestation returns a build from the provenance attestation
func NewFromConfigFile ¶
func (*Build) RunAttestation ¶
func (*Build) RunWithOptions ¶
func (b *Build) RunWithOptions(opts *RunOptions) *Run
type Config ¶
type Config struct { SBOM bool `yaml:"sbom"` // When true, write an SBOM in the working dir ProvenanceDir string `yaml:"provenance"` // Directory to write provenance data Runner RunnerConfig `yaml:"runner"` // Tag determining the runner to use Artifacts ArtifactsConfig `yaml:"artifacts"` // Data about artifacts expected to be built Materials MaterialsConfig `yaml:"materials"` // List of materials defined Secrets []SecretConfig `yaml:"secrets"` // Secrets required by the build Env []EnvConfig `yaml:"env"` // Environment vars to require/set Replacements []ReplacementConfig `yaml:"replacements"` // Replacements to perform before the run Transfers []TransferConfig `yaml:"transfers"` // List of artifacts to be transferred out after the build is done }
func LoadConfig ¶
Load reads a config file and return a config object
type MaterialsConfig ¶
type Options ¶
type Options struct { ForceBuild bool // Execut the builder even if the expected artifacts are found SBOM bool // If true, write an SPDX sbom describing the expected artifacts Workdir string // Working directory. Usually the clone of the repo Source string // Source is the URL for the code repository EnvVars map[string]string // Variables to set when running ProvenanceDir string // FIrectory to save the provenance attestations ConfigFile string // If the build was bootstarpped from a build, this is it ConfigPoint string // git ref of the config file Transfers []TransferConfig // List of artifacts to transfer Artifacts ArtifactsConfig // A list of expected artifacts to be produced by the build Materials MaterialsConfig // List of materials to use for the build }
type ReplacementConfig ¶
type Run ¶
type Run struct { Created time.Time StartTime time.Time EndTime time.Time ProvenancePath string // contains filtered or unexported fields }
Run asbtracts a build run
func (*Run) Provenance ¶
func (r *Run) Provenance() (*intoto.ProvenanceStatement, error)
type RunOptions ¶
type RunOptions struct { ForceBuild bool // When true, build will run even if artifacts exist already SBOM bool // Write an SBOM for the run when true BuildPoint string // git build point where the build will run MaterialsDir string // Directory to store materials Materials MaterialsConfig // List of materials for the build Artifacts ArtifactsConfig // Artifacts configuration Transfers []TransferConfig // Artifacts to transfer out }
RunOptions control specific bits of a build run
type RunnerConfig ¶
type SecretConfig ¶
type SecretConfig struct {
Name string `yaml:"name"` // Name of the secret
}
type TransferConfig ¶
Click to show internal directories.
Click to hide internal directories.