Blame internal/osbuild1/osbuild.go

Packit Service 15f37d
// Package osbuild provides primitives for representing and (un)marshalling
Packit Service 15f37d
// OSBuild (schema v1) types.
Packit Service 15f37d
package osbuild1
Packit Service 15f37d
Packit Service 15f37d
// A Manifest represents an OSBuild source and pipeline manifest
Packit Service 15f37d
type Manifest struct {
Packit Service 15f37d
	Sources  Sources  `json:"sources"`
Packit Service 15f37d
	Pipeline Pipeline `json:"pipeline"`
Packit Service 15f37d
}
Packit Service 15f37d
Packit Service 15f37d
// A Pipeline represents an OSBuild pipeline
Packit Service 15f37d
type Pipeline struct {
Packit Service 15f37d
	// The build environment which can run this pipeline
Packit Service 15f37d
	Build *Build `json:"build,omitempty"`
Packit Service 15f37d
	// Sequence of stages that produce the filesystem tree, which is the
Packit Service 15f37d
	// payload of the produced image.
Packit Service 15f37d
	Stages []*Stage `json:"stages,omitempty"`
Packit Service 15f37d
	// Assembler that assembles the filesystem tree into the target image.
Packit Service 15f37d
	Assembler *Assembler `json:"assembler,omitempty"`
Packit Service 15f37d
}
Packit Service 15f37d
Packit Service 15f37d
type Build struct {
Packit Service 15f37d
	// Pipeline describes how to create the build root
Packit Service 15f37d
	Pipeline *Pipeline `json:"pipeline"`
Packit Service 15f37d
	// The runner to use in this build root
Packit Service 15f37d
	Runner string `json:"runner"`
Packit Service 15f37d
}
Packit Service 15f37d
Packit Service 15f37d
// SetBuild sets the pipeline and runner for generating the build environment
Packit Service 15f37d
// for a pipeline.
Packit Service 15f37d
func (p *Pipeline) SetBuild(pipeline *Pipeline, runner string) {
Packit Service 15f37d
	p.Build = &Build{
Packit Service 15f37d
		Pipeline: pipeline,
Packit Service 15f37d
		Runner:   runner,
Packit Service 15f37d
	}
Packit Service 15f37d
}
Packit Service 15f37d
Packit Service 15f37d
// AddStage appends a stage to the list of stages of a pipeline. The stages
Packit Service 15f37d
// will be executed in the order they are appended.
Packit Service 15f37d
func (p *Pipeline) AddStage(stage *Stage) {
Packit Service 15f37d
	p.Stages = append(p.Stages, stage)
Packit Service 15f37d
}
Packit Service 15f37d
Packit Service 15f37d
// SetAssembler sets the assembler for a pipeline.
Packit Service 15f37d
func (p *Pipeline) SetAssembler(assembler *Assembler) {
Packit Service 15f37d
	p.Assembler = assembler
Packit Service 15f37d
}