specs

package
v0.41.1-geaaru Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Copyright © 2022-2023 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Copyright © 2022-2023 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Copyright © 2022-2023 Macaroni OS Linux See AUTHORS and LICENSE for the license details and contributors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompilationSpec

type CompilationSpec struct {
	Steps      []string `json:"steps" yaml:"steps"` // Are run inside a container and the result layer diff is saved
	Env        []string `json:"env" yaml:"env"`
	Prelude    []string `json:"prelude" yaml:"prelude"` // Are run inside the image which will be our builder
	Image      string   `json:"image" yaml:"image"`
	Seed       string   `json:"seed" yaml:"seed"`
	PackageDir string   `json:"package_dir" yaml:"package_dir"`

	Retrieve []string `json:"retrieve" yaml:"retrieve"`

	OutputPath string   `json:"-" yaml:"-"` // Where the build processfiles go
	Unpack     bool     `json:"unpack" yaml:"unpack"`
	Includes   []string `json:"includes" yaml:"includes"`
	Excludes   []string `json:"excludes" yaml:"excludes"`

	BuildOptions *options.Compiler `json:"build_options" yaml:"build_options"`

	Copy []CopyField `json:"copy" yaml:"copy"`

	RequiresFinalImages bool `json:"requires_final_images" yaml:"requires_final_images"`

	Package *pkg.DefaultPackage `json:"package" yaml:"package"`
}

func NewCompilationSpec

func NewCompilationSpec(b []byte, p pkg.Package) (*CompilationSpec, error)

func (*CompilationSpec) BuildSteps

func (cs *CompilationSpec) BuildSteps() []string

func (*CompilationSpec) CopyRetrieves

func (cs *CompilationSpec) CopyRetrieves(dest string) error

func (*CompilationSpec) EmptyPackage

func (cs *CompilationSpec) EmptyPackage() bool

func (*CompilationSpec) GetExcludes

func (cs *CompilationSpec) GetExcludes() []string

func (*CompilationSpec) GetImage

func (cs *CompilationSpec) GetImage() string

func (*CompilationSpec) GetIncludes

func (cs *CompilationSpec) GetIncludes() []string

func (*CompilationSpec) GetOutputPath

func (cs *CompilationSpec) GetOutputPath() string

func (*CompilationSpec) GetPackage

func (cs *CompilationSpec) GetPackage() pkg.Package

func (*CompilationSpec) GetPackageDir

func (cs *CompilationSpec) GetPackageDir() string

func (*CompilationSpec) GetPreBuildSteps

func (cs *CompilationSpec) GetPreBuildSteps() []string

func (*CompilationSpec) GetRetrieve

func (cs *CompilationSpec) GetRetrieve() []string

func (*CompilationSpec) GetSeedImage

func (cs *CompilationSpec) GetSeedImage() string

func (*CompilationSpec) HasImageSource

func (cs *CompilationSpec) HasImageSource() bool

HasImageSource returns true when the compilation spec has an image source. a compilation spec has an image source when it depends on other packages or have a source image explictly supplied

func (*CompilationSpec) Hash

func (cs *CompilationSpec) Hash() (string, error)

func (*CompilationSpec) ImageUnpack

func (cs *CompilationSpec) ImageUnpack() bool

func (*CompilationSpec) IsValid

func (cs *CompilationSpec) IsValid() (bool, error)

func (*CompilationSpec) IsVirtual

func (cs *CompilationSpec) IsVirtual() bool

IsVirtual returns true if the spec is virtual. A spec is virtual if the package is empty, and it has no image source to unpack from.

func (*CompilationSpec) Json

func (cs *CompilationSpec) Json() ([]byte, error)

func (*CompilationSpec) Rel

func (p *CompilationSpec) Rel(s string) string

func (*CompilationSpec) RenderBuildImage

func (cs *CompilationSpec) RenderBuildImage() (string, error)

RenderBuildImage renders the dockerfile of the image used as a pre-build step

func (*CompilationSpec) RenderStepImage

func (cs *CompilationSpec) RenderStepImage(image string) (string, error)

RenderStepImage renders the dockerfile used for the image used for building the package

func (*CompilationSpec) SetBuildOptions

func (cs *CompilationSpec) SetBuildOptions(b options.Compiler)

func (*CompilationSpec) SetImage

func (cs *CompilationSpec) SetImage(s string)

func (*CompilationSpec) SetOutputPath

func (cs *CompilationSpec) SetOutputPath(s string)

func (*CompilationSpec) SetPackageDir

func (cs *CompilationSpec) SetPackageDir(s string)

func (*CompilationSpec) SetSeedImage

func (cs *CompilationSpec) SetSeedImage(s string)

func (*CompilationSpec) UnpackedPackage

func (cs *CompilationSpec) UnpackedPackage() bool

func (*CompilationSpec) WriteBuildImageDefinition

func (cs *CompilationSpec) WriteBuildImageDefinition(path string) error

func (*CompilationSpec) WriteStepImageDefinition

func (cs *CompilationSpec) WriteStepImageDefinition(fromimage, path string) error

func (*CompilationSpec) YAML

func (cs *CompilationSpec) YAML() ([]byte, error)

type CompilationSpecLoad

type CompilationSpecLoad struct {
	*pkg.DefaultPackage `json:"-,inline" yaml:"-,inline"`

	Steps      []string `json:"steps,omitempty" yaml:"steps,omitempty"` // Are run inside a container and the result layer diff is saved
	Env        []string `json:"env,omitempty" yaml:"env,omitempty"`
	Prelude    []string `json:"prelude,omitempty" yaml:"prelude,omitempty"` // Are run inside the image which will be our builder
	Image      string   `json:"image,omitempty" yaml:"image,omitempty"`
	Seed       string   `json:"seed,omitempty" yaml:"seed,omitempty"`
	PackageDir string   `json:"package_dir,omitempty" yaml:"package_dir,omitempty"`

	Retrieve []string `json:"retrieve,omitempty" yaml:"retrieve,omitempty"`

	OutputPath string   `json:"-" yaml:"-"` // Where the build processfiles go
	Unpack     bool     `json:"unpack,omitempty" yaml:"unpack,omitempty"`
	Includes   []string `json:"includes,omitempty" yaml:"includes,omitempty"`
	Excludes   []string `json:"excludes,omitempty" yaml:"excludes,omitempty"`

	BuildOptions *options.Compiler `json:"build_options,omitempty" yaml:"build_options,omitempty"`

	Copy []CopyField `json:"copy,omitempty" yaml:"copy,omitempty"`

	RequiresFinalImages bool `json:"requires_final_images,omitempty" yaml:"requires_final_images,omitempty"`
}

func NewComplationSpecLoad

func NewComplationSpecLoad() *CompilationSpecLoad

func (*CompilationSpecLoad) BuildSteps

func (cs *CompilationSpecLoad) BuildSteps() []string

func (*CompilationSpecLoad) EmptyPackage

func (cs *CompilationSpecLoad) EmptyPackage() bool

func (*CompilationSpecLoad) GetImage

func (cs *CompilationSpecLoad) GetImage() string

func (*CompilationSpecLoad) GetPackageDir

func (cs *CompilationSpecLoad) GetPackageDir() string

func (*CompilationSpecLoad) HasImageSource

func (cs *CompilationSpecLoad) HasImageSource() bool

HasImageSource returns true when the compilation spec has an image source. a compilation spec has an image source when it depends on other packages or have a source image explictly supplied

func (*CompilationSpecLoad) ImageUnpack

func (cs *CompilationSpecLoad) ImageUnpack() bool

func (*CompilationSpecLoad) IsVirtual

func (cs *CompilationSpecLoad) IsVirtual() bool

IsVirtual returns true if the spec is virtual. A spec is virtual if the package is empty, and it has no image source to unpack from.

func (*CompilationSpecLoad) Json

func (cs *CompilationSpecLoad) Json() ([]byte, error)

func (*CompilationSpecLoad) ToSpec

func (csl *CompilationSpecLoad) ToSpec() *CompilationSpec

func (*CompilationSpecLoad) UnpackedPackage

func (cs *CompilationSpecLoad) UnpackedPackage() bool

func (*CompilationSpecLoad) YAML

func (cs *CompilationSpecLoad) YAML() ([]byte, error)

type Compilationspecs

type Compilationspecs []CompilationSpec

func NewCompilationspecs

func NewCompilationspecs(s ...*CompilationSpec) *Compilationspecs

func (*Compilationspecs) Add

func (specs *Compilationspecs) Add(s *CompilationSpec)

func (*Compilationspecs) All

func (specs *Compilationspecs) All() []*CompilationSpec

func (Compilationspecs) Len

func (specs Compilationspecs) Len() int

func (*Compilationspecs) Remove

func (*Compilationspecs) Unique

func (specs *Compilationspecs) Unique() *Compilationspecs

type CopyField

type CopyField struct {
	Package     *pkg.DefaultPackage `json:"package" yaml:"package"`
	Image       string              `json:"image" yaml:"image"`
	Source      string              `json:"source" yaml:"source"`
	Destination string              `json:"destination" yaml:"destination"`
}

type Signature

type Signature struct {
	Image               string
	Steps               []string
	PackageDir          string
	Prelude             []string
	Seed                string
	Env                 []string
	Retrieve            []string
	Unpack              bool
	Includes            []string
	Excludes            []string
	Copy                []CopyField
	Requires            pkg.DefaultPackages
	RequiresFinalImages bool
}

Signature is a portion of the spec that yields a signature for the hash

Jump to

Keyboard shortcuts

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