yb

package module
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

README

YourBase

YourBase Community Slack

yb build all-the-things!

YourBase is a build tool that makes working on projects much more delightful. Stop worrying about dependencies, keep your CI build process in-sync with your local development process and onboard new team members with ease.

The primary features of the YB tooling are:

  • Consistent local and CI tooling How a project is built as part of the CI/CD process should not be any different than how it is built on a developer's machine. Keeping tooling in-sync means predictable results and a better developer experience for everyone. (Although local builds are not fully isolated yet)

  • Accelerated on-boarding Many projects have long sets of instructions that are required for a developer to get started. With YB, the experience is as simple as getting source code and running yb build - batteries included!

  • Programmatic dependency management No need to have developers manually install and manage different versions of Go, Node, Java, etc. By describing these tools in codified build-packs, these can be installed and configured automatically on a per-project basis. Manage containers and other runtime dependencies programmatically and in a consistent manner.

  • Remote builds Run your work and tests in the cloud just like you would locally or as part of CI! Stream the results back to your machine in real-time to offload the work.

magic!

Installation

yb is available for Mac via Homebrew, and Linux/WSL2 via apt-get. Instructions are available at https://docs.yourbase.io/installation.html

Getting Started

To use yb, you need a .yourbase.yml file at the top of your project directory. You can run yb init to generate one:

cd path/to/my/project
yb init
yb build

For a more in-depth tutorial, see https://docs.yourbase.io/getting-started.html

Documentation

Documentation is available at docs.yourbase.io/cli

Contributing

We welcome contributions to this project! Please see the contributor's guide for more information.

License

This project is licensed under an Apache 2.0 license.

Documentation

Index

Constants

View Source
const DefaultContainerImage = "yourbase/yb_ubuntu:18.04"

DefaultContainerImage is the Docker image used when none is specified.

View Source
const DefaultExecEnvironment = "default"

DefaultExecEnvironment is the name of the execution environment variable set that should be used when no options are given to yb exec.

View Source
const DefaultTarget = "default"

DefaultTarget is the name of the target that should be built when no arguments are given to yb build.

View Source
const PackageConfigFilename = ".yourbase.yml"

PackageConfigFilename is the name of the file at the base of a package directory containing the package's configuration.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildpackSpec

type BuildpackSpec string

BuildpackSpec is a buildpack specifier, consisting of a name and a version.

func ParseBuildpackSpec

func ParseBuildpackSpec(s string) (BuildpackSpec, error)

ParseBuildpackSpec validates a buildpack specifier string.

func (BuildpackSpec) Name

func (spec BuildpackSpec) Name() string

func (BuildpackSpec) Version

func (spec BuildpackSpec) Version() string

type EnvTemplate added in v0.6.0

type EnvTemplate string

EnvTemplate is an expression for an environment variable value. It's mostly a literal string, but may include substitutions for container IP addresses in the form `{{ .Containers.IP "mycontainer" }}`.

type Package

type Package struct {
	// Name is the name of the package directory.
	Name string
	// Path is the absolute path to the package directory.
	Path string
	// Targets is the set of targets in the package, keyed by target name.
	Targets map[string]*Target
	// ExecEnvironments is the set of targets representing the exec phase
	// in the configuration, keyed by environment name.
	ExecEnvironments map[string]*Target
}

Package is a parsed build configuration (from .yourbase.yml).

func LoadPackage

func LoadPackage(configPath string) (*Package, error)

LoadPackage loads the package for the given .yourbase.yml file.

type ResourceDefinition added in v0.6.0

type ResourceDefinition struct {
	narwhal.ContainerDefinition

	HealthCheckTimeout time.Duration
}

type Target added in v0.6.0

type Target struct {
	Name    string
	Package *Package
	Deps    map[*Target]struct{}
	Tags    map[string]string

	// Container specifies the container environment that should be used to run
	// the commands in if container execution is requested. It will never be nil.
	Container *narwhal.ContainerDefinition
	// UseContainer indicates whether this target requires executing the commands
	// inside a container.
	UseContainer bool

	Commands   []string
	RunDir     string
	Env        map[string]EnvTemplate
	Buildpacks map[string]BuildpackSpec
	Resources  map[string]*ResourceDefinition
}

A Target is a buildable unit.

func BuildOrder added in v0.6.0

func BuildOrder(desired ...*Target) []*Target

BuildOrder returns a topological sort of the targets needed to build the given target(s). If a single argument is passed, then the last element in the returned slice is always the argument.

Directories

Path Synopsis
cmd
yb
internal
biome
Package biome provides an API for interacting with build environments.
Package biome provides an API for interacting with build environments.
biome/replay
Package replay provides a biome that records all events to an underlying biome and then allows replaying those command invocations later.
Package replay provides a biome that records all events to an underlying biome and then allows replaying those command invocations later.
build
Package build provides the algorithm for building yb targets.
Package build provides the algorithm for building yb targets.
ybdata
Package ybdata locates directories the user has designated or conventionally uses for storing different types of data.
Package ybdata locates directories the user has designated or conventionally uses for storing different types of data.

Jump to

Keyboard shortcuts

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