v0.2.0 Latest Latest

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

Go to latest
Published: Jan 6, 2016 License: MPL-2.0 Imports: 8 Imported by: 99



ScriptPacks are pure shell libraries for implementing complex behavior. The libraries are well unit tested and can depend on other ScriptPacks to promote stability and reusability.

You can read the full documentation on ScriptPacks for more information.



Package scriptpack is used to work with "ScriptPacks" which are packages of shell scripts that app types can define and use to get things done on the remote machine, whether its for development or deployment.

ScriptPacks are 100% pure shell scripting. Any inputs must be received from environment variables. They aren't allowed to template at all. This is all done to ensure testability of the ScriptPacks.

These are treated as first class elements within Otto to assist with testing.

To create your own scriptpack, see the "template" folder within this directory. The folder structure and contents are important for scriptpacks to function correctly.



This section is empty.


This section is empty.


This section is empty.


type ScriptPack

type ScriptPack struct {
	// Name is an identifying name used to name the environment variables.
	// For example the root of where the files are will always be
	Name string

	// Data is the compiled bindata for this ScriptPack. The entire
	// AssetDirectory will be copied starting from "/data"
	Data bindata.Data

	// Dependencies are a list of other ScriptPacks that will always be
	// unpacked alongside this ScriptPack. By referencing actual ScriptPack
	// pointers, the dependencies will also be statically compiled into
	// the Go binaries that contain them.
	// Dependencies can be accessed at the path specified by
	// SCRIPTPACK_<DEP>_ROOT. Note that if you depend on a ScriptPack
	// which itself has a conflicting named dependency, then the first
	// one loaded will win. Be careful about this.
	Dependencies []*ScriptPack

ScriptPack is a struct representing a single ScriptPack. This is exported from the various scriptpacks.

func (*ScriptPack) Env

func (s *ScriptPack) Env(path string) map[string]string

Env returns the environment variables that should be set for this ScriptPack when it is executed.

path is the path to the root of the directory where Write was called to write the ScriptPack output.

func (*ScriptPack) Write

func (s *ScriptPack) Write(dst string) error

Write writes the contents of the ScriptPack and any dependencies into the given directory.

func (*ScriptPack) WriteArchive

func (s *ScriptPack) WriteArchive(dst string) error

WriteArchive writes the contents of the ScriptPack as a tar gzip to the given path.


Path Synopsis

Jump to

Keyboard shortcuts

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