cli

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2018 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationFlags

type ApplicationFlags struct {
	LogOutput string `commander:"flag=log-output,The output file path for the logs."`
	LogLevel  string `commander:"flag=log-level,The level at which to log."`
	LogFormat string `commander:"flag=log-fmt,The format of the logs."`

	Profile bool `commander:"flag=cpu-profile,Profile the application."`
}

ApplicationFlags contains all of the flags for the top level CLI app.

type BuildApplication

type BuildApplication struct {
	ApplicationFlags `commander:"flagstruct"`
	BuildFlags       `commander:"flagstruct=build"`
	// contains filtered or unexported fields
}

BuildApplication contains the bindings for the `makisu build` command.

func NewBuildApplication

func NewBuildApplication() *BuildApplication

NewBuildApplication returns a new instance of application. The version of the application is used as a seed to any cache ID computation, so different versions will result in a break of caching layers.

func (*BuildApplication) AddCleanup

func (app *BuildApplication) AddCleanup(fn func() error)

AddCleanup adds a cleanup function to run after the application exits.

func (*BuildApplication) CLIName

func (app *BuildApplication) CLIName() string

CLIName returns the name of the application. Commander uses this when showing usage information.

func (*BuildApplication) Cleanup

func (app *BuildApplication) Cleanup() error

Cleanup cleans up the application after it has run its command.

func (*BuildApplication) GetCommandDescription

func (app *BuildApplication) GetCommandDescription(cmd string) string

GetCommandDescription returns the description of the given application command. This is used by commander when displaying the help messages.

func (*BuildApplication) Help

func (app *BuildApplication) Help()

Help displays the usage of makisu.

func (*BuildApplication) PostFlagParse

func (app *BuildApplication) PostFlagParse() error

PostFlagParse initializes the standard logger and sets up profiling if need be. This implements the commander.PostFlagParseHook interface, so this function will get called after the Application struct gets injected with the values taken from the flags and arguments of the CLI; but before any of the Build/Pull (etc...) functions get called.

type BuildFlags

type BuildFlags struct {
	DockerfilePath string `commander:"flag=f,The absolute path to the dockerfile"`
	Tag            string `commander:"flag=t,image tag (required)"`

	Arguments      map[string]string `commander:"flag=build-args,Arguments to the dockerfile as per the spec of ARG. Format is a json object."`
	Destination    string            `commander:"flag=dest,Destination of the image tar."`
	PushRegistries string            `commander:"flag=push,Push image after build to the comma-separated list of registries."`
	RegistryConfig string            `` /* 154-byte string literal not displayed */

	AllowModifyFS bool   `commander:"flag=modifyfs,Allow makisu to touch files outside of its own storage and sandbox dir."`
	StorageDir    string `commander:"flag=storage,Directory that makisu uses for cached layer files. Mount this path for better caching performance."`

	DockerHost    string `commander:"flag=docker-host,Docker host to load images to."`
	DockerVersion string `commander:"flag=docker-version,Version string for loading images to docker."`
	DockerScheme  string `commander:"flag=docker-scheme,Scheme for api calls to docker daemon."`
	DoLoad        bool   `commander:"flag=load,Load image after build."`

	RedisCacheAddress   string `commander:"flag=redis-cache-addr,The address of a redis cache server for cacheID to layer sha mapping."`
	RedisCacheTTL       int    `commander:"flag=redis-cache-ttl,The TTL of each cacheID-sha mapping entry in seconds."`
	FileCachePath       string `commander:"flag=file-cache-path,The path of a local file for cacheID to layer sha mapping. Used for testing only."`
	CompressionLevelStr string `commander:"flag=compression,Image compression level, could be 'no', 'speed', 'size', 'default'."`
	Commit              string `` /* 146-byte string literal not displayed */
	// contains filtered or unexported fields
}

BuildFlags contains all of the flags for `makisu build ...`

func (BuildFlags) Build

func (cmd BuildFlags) Build(contextDir string) error

Build image from the specified dockerfile. If -push is specified, will also push the image to those registries. If -load is specified, will load the image into the local docker daemon.

func (BuildFlags) GetTargetRegistries

func (cmd BuildFlags) GetTargetRegistries() []string

GetTargetRegistries returns the target registries that the image should be pushed to.

Jump to

Keyboard shortcuts

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