Documentation
¶
Index ¶
- func Build(ctx *app.Context, opts *BuildOptions) error
- func Dev(opts *DevOptions) *router.Router
- func DevDep(dst *app.Context, src *app.Context, opts *DevDepOptions) (*app.DevDep, error)
- func Project(ctx *context.Shared) *hashitools.Project
- type BuildOptions
- type DevDepOptions
- type DevOptions
- type SSHCache
- type Vagrant
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
func Build(ctx *app.Context, opts *BuildOptions) error
Build can be used to use Vagrant to build something. This will handle starting Vagrant, running the script, collecting files into a list, and destroying the Vagrant environment.
func Dev ¶
func Dev(opts *DevOptions) *router.Router
Dev can be used as an implementation of app.App.Dev to automatically handle creating a development environment and forwarding commands down to Vagrant.
Types ¶
type BuildOptions ¶
type DevDepOptions ¶
type DevDepOptions struct {
// Dir is the directory where Vagrant will be executed.
Dir string
// Script is the script to run to build the dev dependency.
Script string
// Files are the resulting files relative to the cache directory
// that are part of the dep. If these don't exist, an error will be
// generated.
Files []string
}
type DevOptions ¶
type DevOptions struct {
// Dir is the path to the directory with the Vagrantfile. This
// will default to `#{ctx.Dir}/dev` if empty.
Dir string
// DataDir is the path to the directory where Vagrant should store its data.
// Defaults to `#{ctx.LocalDir/vagrant}` if empty.
DataDir string
// Instructions are help text that is shown after creating the
// development environment.
Instructions string
}
DevOptions is the configuration struct used for Dev.
type SSHCache ¶
type SSHCache struct {
// Path is the path to where the SSH cache file should go
Path string
// Vagrant is the Vagrant instance we'll use to execute Vagrant commands.
Vagrant *Vagrant
}
SSHCache is a helper to cache the SSH connection info from Vagrant and use that for executing to avoid the overhead of loading Vagrant.
type Vagrant ¶
type Vagrant struct {
// Dir is the working directory where all Vagrant commands will
// be executed from.
Dir string
// DataDir is the directory where Vagrant commands should store data.
DataDir string
// Env is extra environment variables to set when executing Vagrant.
// This will be on top of the environment variables that are in this
// process.
Env map[string]string
// Ui, if given, will be used to stream output from the Vagrant
// commands. If this is nil, then the output will be logged but
// won't be visible to the user.
Ui ui.Ui
}
Vagrant wraps `vagrant` execution into an easy-to-use API.
Click to show internal directories.
Click to hide internal directories.