dagger

package module
v0.0.0-...-6db59de Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

README

A Go library for working with V3 buildpacks

Dagger Setup:

  1. install the [pack cli tool](from https://github.com/buildpack/pack)
  2. install docker
  3. Verify all tests pass using
    go test -v ./...
    

Documentation

Index

Constants

View Source
const (
	Tiny              = "org.cloudfoundry.stacks.tiny"
	CFLinuxFS3        = "org.cloudfoundry.stacks.cflinuxfs3"
	Bionic            = "io.buildpacks.stacks.bionic"
	DefaultBuildImage = "cloudfoundry/build:full-cnb"
	DefaultRunImage   = "cloudfoundry/run:full-cnb"
	TestBuilderImage  = "cloudfoundry/cnb:cflinuxfs3"
	Cflinuxfs3Builder = "cloudfoundry/cnb:cflinuxfs3"
	BionicBuilder     = "cloudfoundry/cnb:bionic"
)

Variables

This section is empty.

Functions

func DeleteBuildpack

func DeleteBuildpack(root string) error

func DockerArtifactExists

func DockerArtifactExists(name string) (bool, error)

func FindBPRoot

func FindBPRoot() (string, error)

func GetLatestBuildpack

func GetLatestBuildpack(name string) (string, error)

func GetLatestCommunityBuildpack

func GetLatestCommunityBuildpack(org, name string) (string, error)

func GetLatestUnpackagedBuildpack

func GetLatestUnpackagedBuildpack(name string) (string, error)

func GetLatestUnpackagedCommunityBuildpack

func GetLatestUnpackagedCommunityBuildpack(org, name string) (string, error)

func PackageBuildpack

func PackageBuildpack(root string) (string, error)

func PackageCachedBuildpack

func PackageCachedBuildpack(root string) (string, string, error)

func SyncParallelOutput

func SyncParallelOutput(f func())

Types

type App

type App struct {
	ImageName   string
	CacheImage  string
	ContainerID string
	Memory      string
	Env         map[string]string
	// contains filtered or unexported fields
}

func NewApp

func NewApp(fixturePath, imageName, cacheImage string, buildLogs *bytes.Buffer, env map[string]string) App

func PackBuild

func PackBuild(appDir string, buildpacks ...string) (*App, error)

func PackBuildNamedImage

func PackBuildNamedImage(appImage, appDir string, buildpacks ...string) (*App, error)

This pack builds an app from appDir into appImageName, to allow specifying an image name in a test

func PackBuildNamedImageWithEnv

func PackBuildNamedImageWithEnv(appImage, appDir string, env map[string]string, buildpacks ...string) (*App, error)

func PackBuildWithEnv

func PackBuildWithEnv(appDir string, env map[string]string, buildpacks ...string) (*App, error)

func (*App) BuildLogs

func (a *App) BuildLogs() string

func (*App) Destroy

func (a *App) Destroy() error

func (*App) Files

func (a *App) Files(path string) ([]string, error)

func (App) GetBaseURL

func (a App) GetBaseURL() string

func (*App) HTTPGet

func (a *App) HTTPGet(path string) (string, map[string][]string, error)

func (*App) HTTPGetBody

func (a *App) HTTPGetBody(path string) (string, error)

func (*App) Info

func (a *App) Info() (cID string, imageID string, cacheID []string, e error)

func (*App) Logs

func (a *App) Logs() (string, error)

func (*App) SetHealthCheck

func (a *App) SetHealthCheck(command, interval, timeout string)

func (*App) Start

func (a *App) Start() error

func (*App) StartWithCommand

func (a *App) StartWithCommand(startCmd string) error

type Executable

type Executable interface {
	Execute(pexec.Execution) error
}

type HealthCheck

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

type Pack

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

func NewPack

func NewPack(dir string, options ...PackOption) Pack

func (Pack) Build

func (p Pack) Build() (*App, error)

type PackOption

type PackOption func(Pack) Pack

func NoPull

func NoPull() PackOption

func RandomImage

func RandomImage() PackOption

func SetBuilder

func SetBuilder(builder string) PackOption

func SetBuildpacks

func SetBuildpacks(buildpacks ...string) PackOption

func SetEnv

func SetEnv(env map[string]string) PackOption

func SetImage

func SetImage(image string) PackOption

func SetOffline

func SetOffline() PackOption

func SetVerbose

func SetVerbose() PackOption

type TestConfig

type TestConfig struct {
	Builder        string              `json:"builder"`
	BuildpackOrder map[string][]string `json:"buildpackOrder"`
}

func ParseConfig

func ParseConfig(configPath string) (TestConfig, error)

Directories

Path Synopsis
fakes

Jump to

Keyboard shortcuts

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