core

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorTestsFailed = errors.New("Tests Failed")
View Source
var Workspace = &workspace{}

Workspace project workspace

Functions

This section is empty.

Types

type BuildImage

type BuildImage struct {
	Name                string `json:"name"`
	Repository          string `json:"repository"`
	Tag                 string `json:"tag"`
	FullyQualifiedImage string `json:"fully_qualified_image"`
}

BuildImage image data produced by a build

func (*BuildImage) WriteManifest

func (image *BuildImage) WriteManifest(dir string) error

WriteManifest writes out a descriptor about what was built

type Piler

type Piler struct {
	Force     bool
	SkipPush  bool
	SkipTests bool
}

Piler options for performing a pile build operation

func (*Piler) Build

func (piler *Piler) Build(project *Project) (*BuildImage, error)

Build performs a build on a given project

func (*Piler) RunTests

func (piler *Piler) RunTests(project *Project) error

RunTests runs tests for a project

type Project

type Project struct {
	Dir string

	Config            ProjectConfig
	CanBuild          bool
	GitVersion        *gitver.GitVersion
	Repository        string
	Tag               string
	Image             string
	ImageWithRegistry string
}

Project data about an active project

func (*Project) ContextDir

func (project *Project) ContextDir() string

ContextDir returns the context directory absolute path

func (*Project) Load

func (project *Project) Load(defaults *ProjectConfig) error

Load loads a project given a set of defaults from the root

type ProjectConfig

type ProjectConfig struct {
	// Alternative name for this image. If none specified, defaults to the directory of the project
	Name string

	// Alternate context directory (Directory to "build" the image from)
	ContextDir string `yaml:"context_dir"`

	// Prefix for the container image name
	ImagePrefix string `yaml:"image_prefix"`

	// Prefix to add in front of the calculated version. Useful for SemVer/CalVer or for variations of an image in the same registry
	VersionPrefix string `yaml:"version_prefix"`

	// Template for computing the version strong
	VersionTemplate string `yaml:"version_template"`

	// Relative paths to other projects that this project depends on. These are incorporated into the version string
	DependsOn []string `yaml:"depends_on"`

	// Arguments passed to the build command via `--build-arg`
	BuildArgs map[string]string `yaml:"build_args"`

	// Optional testing
	Test struct {
		// Alternate target in a multi-stage build to use for tests. Build is only successful if the tests succeed
		Target string

		// Copies test results from the container to the local filesystem (via docker cp)
		CopyResults struct {
			// Location to copy files from in the container. Example: /app/build/.
			SrcPath string `yaml:"src_path"`
			// Location to copy files to relative to the project directory. Example: build
			DstPath string `yaml:"dst_path"`
		} `yaml:"copy_results"`
	}

	// Docker registry settings for pushing images to and caching already built images
	Registry registry.Config
}

ProjectConfig configuration for a project

Jump to

Keyboard shortcuts

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