packager

package
v0.9.1-beta2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DockerAppCustomVersion1_0_0 is the custom payload version 1.0.0
	DockerAppPayloadVersion1_0_0 = "1.0.0"

	// DockerAppCustomVersionCurrent the current payload version
	// The version must be bumped each time the Payload format change.
	DockerAppPayloadVersionCurrent = DockerAppPayloadVersion1_0_0
)
View Source
const (
	// CNABVersion1_0_0 is the CNAB Schema version 1.0.0
	CNABVersion1_0_0 = "v1.0.0"
)
View Source
const (
	// DefaultCNABBaseImageName is the name of the default base invocation image.
	DefaultCNABBaseImageName = "docker/cnab-app-base"
)

Variables

This section is empty.

Functions

func BaseInvocationImage added in v0.8.0

func BaseInvocationImage(cli command.Cli) string

BaseInvocationImage returns the name and tag of the CNAB base invocation image

func CheckAppVersion

func CheckAppVersion(stderr io.Writer, bndl *bundle.Bundle) error

CheckAppVersion prints a warning if the bundle was built with a different version of docker app

func CustomPayload

func CustomPayload(b *bundle.Bundle) (interface{}, error)

CustomPayload parses and returns the bundle's custom payload

func Extract

func Extract(name string, ops ...func(*types.App) error) (*types.App, error)

Extract extracts the app content if argument is an archive, or does nothing if a dir. It returns source file, effective app name, and cleanup function If appname is empty, it looks into cwd, and all subdirs for a single matching .dockerapp If nothing is found, it looks for an image and loads it

func ExtractCNABParametersValues added in v0.8.0

func ExtractCNABParametersValues(mapping CNABParametersMapping, env []string) map[string]string

ExtractCNABParametersValues extracts the parameter values from the given CNAB environment

func GetNamedTagged

func GetNamedTagged(tag string) (reference.NamedTagged, error)

func Init

func Init(errWriter io.Writer, name string, composeFile string) (string, error)

Init is the entrypoint initialization function. It generates a new application definition based on the provided parameters and returns the path to the created application definition.

func MakeBundleFromApp

func MakeBundleFromApp(dockerCli command.Cli, app *types.App, refOverride reference.NamedTagged) (*bundle.Bundle, error)

func MakeCNABImageName

func MakeCNABImageName(appName, appVersion, suffix string) (string, error)

func MakeInvocationImageName

func MakeInvocationImageName(meta metadata.AppMetadata, refOverride reference.NamedTagged) (string, error)

func PackInvocationImageContext added in v0.8.0

func PackInvocationImageContext(cli command.Cli, app *types.App, target io.Writer) error

PackInvocationImageContext creates a Docker build context for building a CNAB invocation image

func PersistInImageStore

func PersistInImageStore(ref reference.Reference, bndl *bundle.Bundle) (reference.Digested, error)

PersistInImageStore do store a bundle with optional reference and return it's ID

func ToCNAB added in v0.8.0

func ToCNAB(app *types.App, invocationImageName string) (*bundle.Bundle, error)

ToCNAB creates a CNAB bundle from an app package

Types

type CNABParametersMapping added in v0.8.0

type CNABParametersMapping struct {
	CNABEnvToParameter map[string]string
	ParameterToCNABEnv map[string]string
}

CNABParametersMapping describes the desired mapping between parameters and CNAB environment variables

func ExtractCNABParameterMapping added in v0.8.0

func ExtractCNABParameterMapping(parameters parameters.Parameters) CNABParametersMapping

ExtractCNABParameterMapping extracts the CNABParametersMapping from application parameters

type CustomPayloadAppVersion

type CustomPayloadAppVersion interface {
	AppVersion() string
}

CustomPayloadAppVersion is a custom payload with a docker app version

type DockerAppArgs

type DockerAppArgs struct {
	// Labels are the labels to add to containers on run
	Labels map[string]string `json:"labels,omitempty"`
}

DockerAppArgs represent the object passed to the invocation image by Docker App.

type DockerAppCustom

type DockerAppCustom struct {
	// Payload format version
	Version string `json:"version,omitempty"`
	// Custom payload format depends on version
	Payload json.RawMessage `json:"payload,omitempty"`
}

DockerAppCustom contains extension custom data that docker app injects in the bundle.

Jump to

Keyboard shortcuts

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