Documentation
¶
Index ¶
- func CreateApplication(basedir string, name string) error
- func CreateProject(basedir string) error
- type AppBuild
- type AppRun
- type Application
- func (app *Application) Build(env Environment) (string, error)
- func (app *Application) Deploy(node Node, env Environment, lock RiotLock) (*RiotLock, error)
- func (app *Application) GetBuildNode(env Environment) (Node, error)
- func (app *Application) SelectDeploymentTargets(env Environment) ([]Node, error)
- type Environment
- type Issue
- type Node
- type RegistryCfg
- type RiotLock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateApplication ¶
CreateApplication creates a single application with a Dockerfile
func CreateProject ¶
CreateProject initiales a directory with the files and folders required for a riot project
Types ¶
type AppBuild ¶
type AppBuild struct {
NodeSelector string `yaml:"buildsOn"`
Args map[string]*string `yaml:"args"`
DontPush bool `yaml:"dontPush"`
}
AppBuild contains all settings related to an application build
type AppRun ¶
type AppRun struct {
Priviliged bool `yaml:"priviliged"`
Volumes map[string]string `yaml:"volumes"`
Ports map[string]string `yaml:"ports"`
}
AppRun configures an application during runtime
type Application ¶
type Application struct {
Name string
DeploymentSelector []string `yaml:"deploysTo"`
BuildCfg AppBuild `yaml:"build"`
Image string `yaml:"image"`
RunCfg AppRun `yaml:"run"`
}
Application represnts a single app in a riot project
func LoadApp ¶
func LoadApp(basedir string) (*Application, error)
LoadApp loads the application manifest from an application folder
func (*Application) Build ¶
func (app *Application) Build(env Environment) (string, error)
Build builds the image of an application or returns the preconfigured one if there is no Dockerfile
func (*Application) Deploy ¶
func (app *Application) Deploy(node Node, env Environment, lock RiotLock) (*RiotLock, error)
Deploy installs an application on a node
func (*Application) GetBuildNode ¶
func (app *Application) GetBuildNode(env Environment) (Node, error)
GetBuildNode returns the node on which we should build the application image
func (*Application) SelectDeploymentTargets ¶
func (app *Application) SelectDeploymentTargets(env Environment) ([]Node, error)
SelectDeploymentTargets selects all nodes in an environment to which an application ought to be deployed
type Environment ¶
type Environment interface {
GetRegistry() RegistryCfg
GetNodes() []Node
GetApplications() ([]Application, error)
GetApplication(name string) (Application, error)
Validate() ([]Issue, error)
GetBaseDir() string
SelectNodes(selector string) ([]Node, error)
AddNode(node Node)
Save() error
}
Environment is the core configuration of a riot project
func LoadEnv ¶
func LoadEnv(basedir string) (Environment, error)
LoadEnv loads the environment description of a riot project from the basedir
type Node ¶
type Node struct {
Name string `yaml:"name"`
Host string `yaml:"host"`
Labels []string `yaml:"labels"`
}
Node represents a single device on which we can deploy an application to
func (*Node) GetDockerClient ¶
GetDockerClient builds a Docker client for a particular node
func (Node) HasAppRunning ¶
func (node Node) HasAppRunning(imageName string, env Environment) (bool, error)
HasAppRunning checks if an application is currently deployed on a node
func (*Node) IsAvailable ¶
IsAvailable checks if a node is available for container deployment
type RegistryCfg ¶
type RegistryCfg struct {
Host string `yaml:"host"`
Username string `yaml:"user"`
Password string `yaml:"password"`
}
RegistryCfg configures access to a docker registry
func (RegistryCfg) GetAuthString ¶
func (reg RegistryCfg) GetAuthString() (string, error)
GetAuthString computes the base64 authorization string needed for docker registry requests
type RiotLock ¶
type RiotLock struct {
Versions map[string]string `yaml:"versions"`
Deployment map[string]map[string]string `yaml:"deployment"`
}
RiotLock locks an application to a specific image version