Documentation
¶
Index ¶
- func ExpandTemplate(key string, templateString string, context interface{}) (string, error)
- func IsGCENotFound(err error) bool
- func ReadFile(p string) ([]byte, error)
- type AWSCloud
- func (c *AWSCloud) CreateInstance() (Instance, error)
- func (a *AWSCloud) FindImage(imageName string) (Image, error)
- func (a *AWSCloud) GetExtraEnv() (map[string]string, error)
- func (a *AWSCloud) GetInstance() (Instance, error)
- func (a *AWSCloud) TagResource(resourceId string, tags ...*ec2.Tag) error
- func (a *AWSCloud) TerminateInstance(instanceID string) error
- type AWSConfig
- type AWSImage
- type AWSInstance
- type BootstrapVzTemplate
- type Builder
- type Cloud
- type Config
- type GCECloud
- type GCEConfig
- type GCEImage
- type GCEInstance
- type Image
- type Instance
- type LocalhostInstance
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpandTemplate ¶
ExpandTemplate executes a golang template
func IsGCENotFound ¶
Types ¶
type AWSCloud ¶
type AWSCloud struct {
// contains filtered or unexported fields
}
AWSCloud is a helper type for talking to an AWS acccount
func (*AWSCloud) CreateInstance ¶
CreateInstance creates an instance for building an image instance
func (*AWSCloud) GetInstance ¶
GetInstance returns the AWS instance matching our tags, or nil if not found
func (*AWSCloud) TagResource ¶
TagResource adds AWS tags to the specified resource
func (*AWSCloud) TerminateInstance ¶
TerminateInstance terminates the specified instance
type AWSConfig ¶
type AWSConfig struct { Config Region string ImageID string InstanceType string SSHKeyName string SubnetID string SecurityGroupID string Tags map[string]string }
func (*AWSConfig) InitDefaults ¶
type AWSImage ¶
type AWSImage struct {
// contains filtered or unexported fields
}
AWSImage represents an AMI on AWS
func (*AWSImage) EnsurePublic ¶
EnsurePublic makes the image accessible outside the current account
func (*AWSImage) ReplicateImage ¶
ReplicateImage copies the image to all accessable AWS regions
type AWSInstance ¶
type AWSInstance struct {
// contains filtered or unexported fields
}
AWSInstance manages an AWS instance, used for building an image
func (*AWSInstance) DialSSH ¶
func (i *AWSInstance) DialSSH(config *ssh.ClientConfig) (executor.Executor, error)
DialSSH establishes an SSH client connection to the instance
func (*AWSInstance) Shutdown ¶
func (i *AWSInstance) Shutdown() error
Shutdown terminates the running instance
func (*AWSInstance) WaitPublicIP ¶
func (i *AWSInstance) WaitPublicIP() (string, error)
WaitPublicIP waits for the instance to get a public IP, returning it
type BootstrapVzTemplate ¶
type BootstrapVzTemplate struct {
// contains filtered or unexported fields
}
BootstrapVzTemplate represents a bootstrap-vz template file
func NewBootstrapVzTemplate ¶
func NewBootstrapVzTemplate(data string) (*BootstrapVzTemplate, error)
NewBootstrapVzTemplate builds a BootstrapVzTemplate from a file
func (*BootstrapVzTemplate) BuildImageName ¶
func (t *BootstrapVzTemplate) BuildImageName() (string, error)
BuildImageName computes the name of the image that will be built
func (*BootstrapVzTemplate) Bytes ¶
func (t *BootstrapVzTemplate) Bytes() []byte
Bytes returns the template contents
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func (*Builder) BuildImage ¶
func (*Builder) RunSetupCommands ¶
type Config ¶
type Config struct { Cloud string TemplatePath string SetupCommands [][]string BootstrapVZRepo string BootstrapVZBranch string SSHUsername string SSHPublicKey string SSHPrivateKey string InstanceProfile string // Tags to add to the image Tags map[string]string }
func (*Config) InitDefaults ¶
func (c *Config) InitDefaults()
type GCECloud ¶
type GCECloud struct {
// contains filtered or unexported fields
}
GCECloud is a helper type for talking to an GCE acccount
func NewGCECloud ¶
func (*GCECloud) CreateInstance ¶
CreateInstance creates an instance for building an image instance
func (*GCECloud) GetInstance ¶
GetInstance returns the GCE instance matching our tags, or nil if not found
type GCEConfig ¶
type GCEConfig struct { Config // To create an image on GCE, we have to upload it to a bucket first GCSDestination string Project string Zone string MachineName string MachineType string Image string Tags map[string]string }
func (*GCEConfig) InitDefaults ¶
func (c *GCEConfig) InitDefaults()
type GCEImage ¶
type GCEImage struct {
// contains filtered or unexported fields
}
GCEImage represents an image on GCE
func (*GCEImage) EnsurePublic ¶
EnsurePublic makes the image accessible outside the current account
func (*GCEImage) ReplicateImage ¶
ReplicateImage copies the image to all accessible GCE regions
type GCEInstance ¶
type GCEInstance struct {
// contains filtered or unexported fields
}
GCEInstance manages an GCE instance, used for building an image
func (*GCEInstance) DialSSH ¶
func (i *GCEInstance) DialSSH(config *ssh.ClientConfig) (executor.Executor, error)
DialSSH establishes an SSH client connection to the instance
func (*GCEInstance) Shutdown ¶
func (i *GCEInstance) Shutdown() error
Shutdown terminates the running instance
func (*GCEInstance) WaitPublicIP ¶
func (i *GCEInstance) WaitPublicIP() (string, error)
WaitPublicIP waits for the instance to get a public IP, returning it
type LocalhostInstance ¶
type LocalhostInstance struct {
// contains filtered or unexported fields
}
func (*LocalhostInstance) DialSSH ¶
func (i *LocalhostInstance) DialSSH(config *ssh.ClientConfig) (executor.Executor, error)
DialSSH establishes an SSH client connection to the instance
func (*LocalhostInstance) Shutdown ¶
func (i *LocalhostInstance) Shutdown() error
Shutdown terminates the running instance