hlb

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2022 License: Apache-2.0 Imports: 19 Imported by: 1

README

hlb

GoDoc License Test

hlb is a high-level build language for BuildKit.

Describe your build in containerized units of work, and BuildKit will build your target as efficiently as possible.

Getting started with HLB

If you're on a MacOS or Linux (linux-amd64), head on over to Releases to grab a static binary.

Otherwise, you can compile HLB yourself using go:

git clone https://github.com/openllb/hlb.git
cd hlb
go install ./cmd/hlb

Then you can run one of the examples in ./examples:

hlb run ./examples/node.hlb

Bring your own BuildKit

By default, HLB uses the BuildKit embedded in a docker engine. HLB supports BUILDKIT_HOST the same way buildctl does, so you can run BuildKit in a container and connect to it:

docker run -d --name buildkitd --privileged moby/buildkit:master
export BUILDKIT_HOST=docker-container://buildkitd
hlb run ./examples/node.hlb

Language server

If your editor has a decent LSP plugin, HLB does support LSP over stdio via the hlb langserver subcommand.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "0.3+unknown"

Functions

func Client

func Client(ctx context.Context, addr string) (*client.Client, context.Context, error)

Client returns a BuildKit client specified by addr based on BuildKit's connection helpers.

If addr is empty, an attempt is made to connect to docker engine's embedded BuildKit which supports a subset of the exporters and special `moby` exporter.

func Compile

func Compile(ctx context.Context, cln *client.Client, w io.Writer, mod *ast.Module, targets []codegen.Target) (solver.Request, error)

Compile compiles targets in a module and returns a solver.Request.

func NewDockerCli

func NewDockerCli(ctx context.Context) (dockerCli *dockercommand.DockerCli, auth imagetools.Auth, err error)

func WithDefaultContext

func WithDefaultContext(ctx context.Context, cln *client.Client) context.Context

WithDefaultContext adds common context values to the context.

Types

This section is empty.

Directories

Path Synopsis
gen
We make three passes over the CST in the checker.
We make three passes over the CST in the checker.
cmd
hlb
ast
pkg
rpc

Jump to

Keyboard shortcuts

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