Documentation ¶
Index ¶
- Variables
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func GetConfigFilePath() (string, error)
- func InitializeInertiaProject(version, buildType string) error
- func MustAsset(name string) []byte
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- type Config
- type DaemonConfig
- type Deployment
- func (d *Deployment) AddUser(username, password string, admin bool) (*http.Response, error)
- func (d *Deployment) Down() (*http.Response, error)
- func (d *Deployment) ListUsers() (*http.Response, error)
- func (d *Deployment) Logs(stream bool, container string) (*http.Response, error)
- func (d *Deployment) RemoveUser(username string) (*http.Response, error)
- func (d *Deployment) Reset() (*http.Response, error)
- func (d *Deployment) ResetUsers() (*http.Response, error)
- func (d *Deployment) Status() (*http.Response, error)
- func (d *Deployment) Up(buildType string, stream bool) (*http.Response, error)
- type RemoteVPS
- func (remote *RemoteVPS) Bootstrap(runner SSHSession, name string, config *Config) error
- func (remote *RemoteVPS) DaemonDown(session SSHSession) error
- func (remote *RemoteVPS) DaemonUp(session SSHSession, daemonVersion, host, daemonPort string) error
- func (remote *RemoteVPS) GetHost() string
- func (remote *RemoteVPS) GetIPAndPort() string
- type SSHRunner
- type SSHSession
Constants ¶
This section is empty.
Variables ¶
var (
// NoInertiaRemote is used to warn about missing inertia remote
NoInertiaRemote = "No inertia remote"
)
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func GetConfigFilePath ¶
GetConfigFilePath returns the absolute path of the config file.
func InitializeInertiaProject ¶
InitializeInertiaProject creates the inertia config folder and returns an error if we're not in a git project.
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
Types ¶
type Config ¶
type Config struct { Version string `toml:"inertia"` Project string `toml:"project-name"` BuildType string `toml:"build-type"` Remotes []*RemoteVPS `toml:"remote"` Writer io.Writer `toml:"-"` }
Config represents the current projects configuration.
func GetProjectConfigFromDisk ¶
GetProjectConfigFromDisk returns the current project's configuration. If an .inertia folder is not found, it returns an error.
func (*Config) RemoveRemote ¶
RemoveRemote removes remote with given name
type DaemonConfig ¶
type DaemonConfig struct { Port string `toml:"port"` SSHPort string `toml:"ssh_port"` Token string `toml:"token"` Secret string `toml:"secret"` }
DaemonConfig contains parameters for the Daemon
type Deployment ¶
type Deployment struct { *RemoteVPS Repository *git.Repository Auth string Project string BuildType string }
Deployment manages a deployment
func GetDeployment ¶
func GetDeployment(name string) (*Deployment, error)
GetDeployment returns the local deployment setup
func (*Deployment) AddUser ¶ added in v0.3.0
AddUser adds an authorized user for access to Inertia Web
func (*Deployment) Down ¶
func (d *Deployment) Down() (*http.Response, error)
Down brings the project down on the remote VPS instance specified in the configuration object.
func (*Deployment) ListUsers ¶ added in v0.3.0
func (d *Deployment) ListUsers() (*http.Response, error)
ListUsers lists all users on the remote.
func (*Deployment) RemoveUser ¶ added in v0.3.0
func (d *Deployment) RemoveUser(username string) (*http.Response, error)
RemoveUser prevents a user from accessing Inertia Web
func (*Deployment) Reset ¶
func (d *Deployment) Reset() (*http.Response, error)
Reset shuts down deployment and deletes the contents of the deployment's project directory
func (*Deployment) ResetUsers ¶ added in v0.3.0
func (d *Deployment) ResetUsers() (*http.Response, error)
ResetUsers resets all users on the remote.
type RemoteVPS ¶
type RemoteVPS struct { Name string `toml:"name"` IP string `toml:"IP"` User string `toml:"user"` PEM string `toml:"pemfile"` Branch string `toml:"branch"` Daemon *DaemonConfig `toml:"daemon"` }
RemoteVPS contains parameters for the VPS
func (*RemoteVPS) Bootstrap ¶
func (remote *RemoteVPS) Bootstrap(runner SSHSession, name string, config *Config) error
Bootstrap configures a remote vps for continuous deployment by installing docker, starting the daemon and building a public-private key-pair. It outputs configuration information for the user.
func (*RemoteVPS) DaemonDown ¶
func (remote *RemoteVPS) DaemonDown(session SSHSession) error
DaemonDown brings the daemon down on the remote instance
func (*RemoteVPS) DaemonUp ¶
func (remote *RemoteVPS) DaemonUp(session SSHSession, daemonVersion, host, daemonPort string) error
DaemonUp brings the daemon up on the remote instance.
func (*RemoteVPS) GetIPAndPort ¶
GetIPAndPort creates the IP:Port string.