Documentation ¶
Index ¶
- func GetEnvFromConfig(config map[string]interface{}) (map[string]string, error)
- func ResolveDockerPaths(basePath string, buildContextPath string, dockerfilePath string) (resBuildCtxPath string, resDockerfilePath string, isDockerfileRelative bool, ...)
- type BuildAgent
- type CreateAgent
- func (c *CreateAgent) CreateFromDocker(overrideValues map[string]interface{}) (string, error)
- func (c *CreateAgent) CreateFromGithub(ghOpts *GithubOpts, overrideValues map[string]interface{}) (string, error)
- func (c *CreateAgent) CreateFromRegistry(image string, overrideValues map[string]interface{}) (string, error)
- func (c *CreateAgent) CreateSubdomainIfRequired(mergedValues map[string]interface{}) (string, error)
- func (c *CreateAgent) GetImageRepoURL(name, namespace string) (uint, string, error)
- func (c *CreateAgent) GetLatestTemplateDefaultValues(templateName, templateVersion string) (map[string]interface{}, error)
- func (c *CreateAgent) GetLatestTemplateVersion(templateName string) (string, error)
- func (c *CreateAgent) HasDefaultDockerfile(buildPath string) bool
- type CreateOpts
- type DeployAgent
- func (d *DeployAgent) Build() error
- func (d *DeployAgent) GetBuildEnv() (map[string]string, error)
- func (d *DeployAgent) Push() error
- func (d *DeployAgent) SetBuildEnv(envVars map[string]string) error
- func (d *DeployAgent) UpdateImageAndValues(overrideValues map[string]interface{}) error
- func (d *DeployAgent) WriteBuildEnv(fileDest string) error
- type DeployBuildType
- type DeployOpts
- type GithubOpts
- type NestedMapFieldNotFoundError
- type SharedOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetEnvFromConfig ¶
GetEnvFromConfig gets the env vars for a standard Porter template config. These env vars are found at `container.env.normal`.
func ResolveDockerPaths ¶ added in v0.6.0
func ResolveDockerPaths( basePath string, buildContextPath string, dockerfilePath string, ) ( resBuildCtxPath string, resDockerfilePath string, isDockerfileRelative bool, err error, )
ResolveDockerPaths returns a path to the dockerfile that is either relative or absolute, and a path to the build context that is absolute.
The return value will be relative if the dockerfile exists within the build context, absolute otherwise. The second return value is true if the dockerfile exists within the build context, false otherwise.
Types ¶
type BuildAgent ¶
type BuildAgent struct { // contains filtered or unexported fields }
BuildAgent builds a new Docker container image for a new version of an application
func (*BuildAgent) BuildDocker ¶
func (b *BuildAgent) BuildDocker( dockerAgent *docker.Agent, basePath, buildCtx, dockerfilePath, tag string, ) error
BuildDocker uses the local Docker daemon to build the image
type CreateAgent ¶
type CreateAgent struct { Client *api.Client CreateOpts *CreateOpts }
CreateAgent handles the creation of a new application on Porter
func (*CreateAgent) CreateFromDocker ¶
func (c *CreateAgent) CreateFromDocker( overrideValues map[string]interface{}, ) (string, error)
CreateFromDocker uses a local build context and a local Docker daemon to build a new container image, and then deploys it onto Porter.
func (*CreateAgent) CreateFromGithub ¶
func (c *CreateAgent) CreateFromGithub( ghOpts *GithubOpts, overrideValues map[string]interface{}, ) (string, error)
CreateFromGithub uses the branch/repo to link the Github source for an application. This function attempts to find a matching repository in the list of linked repositories on Porter. If one is found, it will use that repository as the app source.
func (*CreateAgent) CreateFromRegistry ¶
func (c *CreateAgent) CreateFromRegistry( image string, overrideValues map[string]interface{}, ) (string, error)
CreateFromRegistry deploys a new application from an existing Docker repository + tag.
func (*CreateAgent) CreateSubdomainIfRequired ¶
func (c *CreateAgent) CreateSubdomainIfRequired(mergedValues map[string]interface{}) (string, error)
func (*CreateAgent) GetImageRepoURL ¶
func (c *CreateAgent) GetImageRepoURL(name, namespace string) (uint, string, error)
GetImageRepoURL creates the image repository url by finding the first valid image registry linked to Porter, and then generates a new name of the form: `{registry}/{name}-{namespace}`
func (*CreateAgent) GetLatestTemplateDefaultValues ¶
func (c *CreateAgent) GetLatestTemplateDefaultValues(templateName, templateVersion string) (map[string]interface{}, error)
GetLatestTemplateDefaultValues gets the default config (`values.yaml`) set for a specific template.
func (*CreateAgent) GetLatestTemplateVersion ¶
func (c *CreateAgent) GetLatestTemplateVersion(templateName string) (string, error)
GetLatestTemplateVersion retrieves the latest template version for a specific Porter template from the chart repository.
func (*CreateAgent) HasDefaultDockerfile ¶
func (c *CreateAgent) HasDefaultDockerfile(buildPath string) bool
HasDefaultDockerfile detects if there is a dockerfile at the path `./Dockerfile`
type CreateOpts ¶
CreateOpts are required options for creating a new application on Porter: the "kind" (web, worker, job) and the name of the application.
type DeployAgent ¶
type DeployAgent struct { App string // contains filtered or unexported fields }
DeployAgent handles the deployment and redeployment of an application on Porter
func NewDeployAgent ¶
func NewDeployAgent(client *api.Client, app string, opts *DeployOpts) (*DeployAgent, error)
NewDeployAgent creates a new DeployAgent given a Porter API client, application name, and DeployOpts.
func (*DeployAgent) Build ¶
func (d *DeployAgent) Build() error
Build uses the deploy agent options to build a new container image from either buildpack or docker.
func (*DeployAgent) GetBuildEnv ¶
func (d *DeployAgent) GetBuildEnv() (map[string]string, error)
GetBuildEnv retrieves the build env from the release config and returns it
func (*DeployAgent) Push ¶
func (d *DeployAgent) Push() error
Push pushes a local image to the remote repository linked in the release
func (*DeployAgent) SetBuildEnv ¶
func (d *DeployAgent) SetBuildEnv(envVars map[string]string) error
SetBuildEnv sets the build env vars in the process so that other commands can use them
func (*DeployAgent) UpdateImageAndValues ¶
func (d *DeployAgent) UpdateImageAndValues(overrideValues map[string]interface{}) error
UpdateImageAndValues updates the current image for a release, along with new configuration passed in via overrrideValues. If overrideValues is nil, it just reuses the configuration set for the application. If overrideValues is not nil, it will merge the overriding values with the existing configuration.
func (*DeployAgent) WriteBuildEnv ¶
func (d *DeployAgent) WriteBuildEnv(fileDest string) error
WriteBuildEnv writes the build env to either a file or stdout
type DeployBuildType ¶
type DeployBuildType string
DeployBuildType is the option to use as a builder
const ( // uses local Docker daemon to build and push images DeployBuildTypeDocker DeployBuildType = "docker" // uses cloud-native build pack to build and push images DeployBuildTypePack DeployBuildType = "pack" )
type DeployOpts ¶
type DeployOpts struct { Local bool }
DeployOpts are the options for creating a new DeployAgent
type GithubOpts ¶
GithubOpts are the options for linking a Github source to the app
type NestedMapFieldNotFoundError ¶
type NestedMapFieldNotFoundError struct {
Field string
}
func (*NestedMapFieldNotFoundError) Error ¶
func (e *NestedMapFieldNotFoundError) Error() string
type SharedOpts ¶
type SharedOpts struct {}
SharedOpts are common options for build, create, and deploy agents