pack

package
v0.3.0-rc3 Latest Latest
Warning

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

Go to latest
Published: May 9, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ChartfileName is the default Chart file name.
	ChartfileName = "Chart.yaml"
	// ChartDir is the relative directory name for the packaged chart with a pack.
	ChartDir = "chart"
	// DetectName is the name of the detect script.
	DetectName = "detect"
	// DockerfileName is the name of the Dockerfile.
	DockerfileName = "Dockerfile"
	// ValuesfileName is the default values file name.
	ValuesfileName = "values.yaml"
	// IgnorefileName is the name of the Helm ignore file.
	IgnorefileName = ".helmignore"
	// DeploymentName is the name of the deployment file.
	DeploymentName = "deployment.yaml"
	// ServiceName is the name of the service file.
	ServiceName = "service.yaml"
	// IngressName is the name of the ingress file.
	IngressName = "ingress.yaml"
	// NotesName is the name of the NOTES.txt file.
	NotesName = "NOTES.txt"
	// HelpersName is the name of the helpers file.
	HelpersName = "_helpers.tpl"
	// TemplatesDir is the relative directory name for templates.
	TemplatesDir = "templates"
	// ChartsDir is the relative directory name for charts dependencies.
	ChartsDir = "charts"
	// HerokuLicenseName is the name of the Neroku License
	HerokuLicenseName = "NOTICE"
	// DockerignoreName is the name of the Docker ignore file
	DockerignoreName = ".dockerignore"
)

Variables

This section is empty.

Functions

func Create

func Create(name, dir string, files []*File) (string, error)

Create creates a new Pack in a directory.

Inside of dir, this will create a directory based on the name. It will then write the Chart.yaml into this directory and create the (empty) appropriate directories.

The returned string will point to the newly created directory. It will be an absolute path, even if the provided base directory was relative.

If dir does not exist, this will return an error. If Chart.yaml or any directories cannot be created, this will return an error. In such a case, this will attempt to clean up by removing the new pack directory.

func CreateFrom

func CreateFrom(chartMeta *chart.Metadata, dest, src string) error

CreateFrom scaffolds a directory with the src pack.

Types

type File

type File struct {
	Path    string
	Content []byte
	Perm    os.FileMode
}

File represents a file within a Pack

type Pack

type Pack struct {
	// Chart is the Helm chart to be installed with the Pack.
	Chart *chart.Chart
	// Dockerfile is the pre-defined Dockerfile that will be installed with the Pack.
	Dockerfile []byte
	// DetectScript is a command that determines if the Pack is a candidate for an app. When
	// .Detect() is called on the Pack, the data here is piped as stdin to `/bin/bash -s`.
	DetectScript []byte
}

Pack defines a Draft Starter Pack.

func FromDir

func FromDir(dir string) (*Pack, error)

FromDir takes a string name, tries to resolve it to a file or directory, and then loads it.

This is the preferred way to load a pack. It will discover the pack encoding and hand off to the appropriate pack reader.

func (*Pack) Detect

func (p *Pack) Detect(dir string) (string, error)

Detect determines if this pack is viable for the given application in dir.

returns a nil err if it is a viable pack. The string returned is the output of the detect script.

func (*Pack) SaveDir

func (p *Pack) SaveDir(dest string, includeDetectScript bool) error

SaveDir saves a pack as files in a directory.

Jump to

Keyboard shortcuts

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