caco3

package
v0.0.0-...-312a33e Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaveRepoSums

func SaveRepoSums(f string, sums *RepoSums) error

SaveRepoSums saves sums to f.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder builds stuff.

func NewBuilder

func NewBuilder(workDir string, config *Config) (*Builder, error)

NewBuilder creates a new builder that builds stuff.

func (*Builder) Build

func (b *Builder) Build(rules []string) []*lexing.Error

Build builds the given rules.

func (*Builder) Out

func (b *Builder) Out(f string) string

Out returns the filesystme path to an output file.

func (*Builder) ReadWorkspace

func (b *Builder) ReadWorkspace() (*Workspace, []*lexing.Error)

ReadWorkspace reads and loads the WORKSPACE file into the build env.

func (*Builder) Src

func (b *Builder) Src(f string) string

Src returns the filesystem path to a source file.

func (*Builder) SyncRepos

func (b *Builder) SyncRepos(sums *RepoSums, opts *SyncOptions) (
	*RepoSums, error,
)

SyncRepos synchronizes the repositories. When sums is nil, it pulls from the latest HEAD.

type Bundle

type Bundle struct {
	// Name of the fule
	Name string

	// Other rule names.
	Deps []string
}

Bundle is a set of build rules in a bundle. A bundle has no build actions; it just group rules together.

type Config

type Config struct {
	Root string // Root directory

	AlwaysRebuild bool // Always rebuild everything.

	UseDockerBuildCache bool // Use docker build cache.
}

Config provide the configuration to start a builder.

type DockerBuild

type DockerBuild struct {
	Name         string
	Dockerfile   string   `json:",omitempty"`
	From         []string `json:",omitempty"`
	Input        []string `json:",omitempty"`
	ArchiveInput []string `json:",omitempty"`
	PrefixDir    string   `json:",omitempty"`
	Args         []string `json:",omitempty"`
	OutputTar    bool     `json:",omitempty"`
}

DockerBuild is a rule to build a docker container image.

type DockerPull

type DockerPull struct {
	Name      string
	Pull      string `json:",omitempty"`
	Digest    string `json:",omitempty"`
	OutputTar bool   `json:",omitempty"`
}

DockerPull is a rule to pull down a docker container image.

type DockerRun

type DockerRun struct {
	Name    string
	Image   string
	User    string   `json:",omitempty"`
	Envs    []string `json:",omitempty"`
	WorkDir string   `json:",omitempty"`

	MountWorkspace string `json:",omitempty"`

	Command []string `json:",omitempty"`

	// Map from input to file inside the container.
	Input map[string]string

	// Map files from zip or tarball archives to directories
	// inside the container.
	ArchiveInput map[string]string

	// Map from output path to file inside the container.
	Output map[string]string `json:",omitempty"`

	// Extra dependencies.
	Deps []string `json:",omitempty"`
}

DockerRun is a rule to run a command inside a docker container image.

type Download

type Download struct {
	Name     string
	URL      string
	Checksum string
	Output   string
}

Download is a rule to download an artifact from the Internet.

type FileSet

type FileSet struct {
	Name string

	// The list of files to include in the fileset.
	Files []string `json:",omitempty"`

	// Selects a set of source input files.
	Select []string `json:",omitempty"`

	// Ignores a set of source input files after selection.
	Ignore []string `json:",omitempty"`

	// Merge in other file sets
	Include []string `json:",omitempty"`
}

FileSet selects a set of files.

type GitRemote

type GitRemote struct {
	Name string
	URL  map[string]string
}

GitRemote defines a set of remote URLs for a given name. It provides a more consistent remote setup for the repositories in the workspace.

type RepoMap

type RepoMap struct {
	GitHosting   map[string]string `json:",omitempty"`
	Src          map[string]string
	ExtraRemotes []*GitRemote `json:",omitempty"`
}

RepoMap contains the list of repos to clone down.

type RepoSums

type RepoSums struct {
	RepoCommits map[string]string
}

RepoSums records the checkums and git commits of a build.

func ReadRepoSums

func ReadRepoSums(f string) (*RepoSums, error)

ReadRepoSums reads in the workspaces's repo checksum file.

type SubBuilds

type SubBuilds struct {
	Dirs []string
}

SubBuilds is a rule to build a set of sub-builds.

type SyncOptions

type SyncOptions struct {
	// Set remotes for existing repositories.
	SetRemotes bool
}

SyncOptions contains options for syncing remote repositories.

type Workspace

type Workspace struct {
	RepoMap *RepoMap
}

Workspace is the structure of the build.jsonx file. It specifies how to build a project.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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