Documentation ¶
Index ¶
- func EvalCommand(name string, args ...string) []byte
- func FindRegexpGroups(line string, re *regexp.Regexp) map[string]string
- func ProcessTemplate(project *Project, in string, out string) error
- func ProcessTemplates(project *Project, inDir string, outDir string) error
- func RunCommand(name string, args ...string) error
- type Context
- type Dockerfile
- type DockerfileInstruction
- type Image
- func (i *Image) Build() error
- func (i *Image) Directory() string
- func (i *Image) Dockerfile() *Dockerfile
- func (i *Image) Load() error
- func (i *Image) Name() string
- func (i *Image) Parent() *Image
- func (i *Image) Push() error
- func (i *Image) Remove() error
- func (i *Image) Save() error
- func (i *Image) String() string
- func (i *Image) Tag() string
- func (i *Image) WorkingDirectory() string
- type Project
- type ProjectImages
- type ProjectManifests
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EvalCommand ¶
EvalCommand executes the given command, waits till it finishes and returns the text that it writes to the standard output. If the execution of the command fails it returns nil.
func FindRegexpGroups ¶
FindRegexGroups checks if line matches the re regular expression. If it does match, then it returns a map containing the names of the groups as the keys and the text that matches each group as the values. If it doesn't match, then it returns nil.
func ProcessTemplate ¶
ProcessTemplate loads the input file, processes it as a template, and writes the result to the output file.
func ProcessTemplates ¶
ProcessTemplates scans all the files in the input directory, processes them as templates, and writes the result to the output directory.
func RunCommand ¶
RunCommand executes the given command and waits till it finishes. The standard output and standard error of the command are redirected to the standard output and standard error of the calling program.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context contains the objects passed to templates when they are evaluated.
type Dockerfile ¶
type Dockerfile struct {
// contains filtered or unexported fields
}
Dockerfile conatins the information extracted from o docker file.
func NewDockerfile ¶
func NewDockerfile() *Dockerfile
NewDockerfile creates a new empty docker file.
func (*Dockerfile) From ¶
func (d *Dockerfile) From() string
From finds the first FROM instruction within a Dockerfile. If that instruction exists then it returns its arguments. If it doesn't exist then it returns an empty string.
func (*Dockerfile) Instruction ¶
func (d *Dockerfile) Instruction(name string) *DockerfileInstruction
Instruction finds the first instruction within the given Dockerfile that haves the given name. If there is no such instruction then it returns nil.
func (*Dockerfile) Load ¶
func (d *Dockerfile) Load(path string) *Dockerfile
Load loads a docker file and builds a list of structures containing the instruction names and arguments.
type DockerfileInstruction ¶
type DockerfileInstruction struct { // The name of the instruction. Name string // The arguments of the instruction. Args string }
Instruction represents each of the instructions that form an Dockerfile.
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
Image contains the description of an image, as well as methods to build it.
func NewImage ¶
NewImage creates a new empty image with the given name and belonging to the given project.
func (*Image) Directory ¶
Directory returns the absolute path of the directory that contains the source files of the image.
func (*Image) Dockerfile ¶
func (i *Image) Dockerfile() *Dockerfile
Dockerfile returns the object that describes the Dockerfile used by the image.
func (*Image) Load ¶
Load loads the details of the image, including the content of the Dockerfile, if it exists.
func (*Image) WorkingDirectory ¶
WorkingDirectory returns the absolute path of the work directory for the image.
type Project ¶
type Project struct {
// contains filtered or unexported fields
}
Project contains the project configuration.
func LoadProject ¶
LoadProject loads a project from the given path. If the path is empty then it will load the project from the 'project.conf' file inside the current working directory.
func (*Project) Close ¶
Close releases all the resources used by the project, including the temporary directory used to store the results of processsing templates. Once the project is closed it can no longer be used.
func (*Project) Directory ¶
Directory returns the the absolute path of the root directory of the project.
func (*Project) Images ¶
func (p *Project) Images() *ProjectImages
Images returns the information about the images that are part of the project.
func (*Project) Manifests ¶
func (p *Project) Manifests() *ProjectManifests
Manifests returns the information about he OpenShift manifests that are part of the project.
func (*Project) WorkingDirectory ¶
WorkingDirectory returns the absolute path of the working directory of the project.
type ProjectImages ¶
type ProjectImages struct {
// contains filtered or unexported fields
}
ProjectImages contains the information about the images that are part of the project.
func (*ProjectImages) Directory ¶
func (pi *ProjectImages) Directory() string
Directory returns the absolute path of the directory containing the source files of the image specifications.
func (*ProjectImages) Index ¶
func (pi *ProjectImages) Index() map[string]*Image
Index returns a map containing the images that are part of the project, indexed by name.
func (*ProjectImages) List ¶
func (pi *ProjectImages) List() []*Image
List returns a slice containing the images that are part of the project, sorted in the right build order.
func (*ProjectImages) Prefix ¶
func (pi *ProjectImages) Prefix() string
Prefix returns the prefix that should be used to tag the images of the project.
func (*ProjectImages) Registry ¶
func (pi *ProjectImages) Registry() string
Registry returns the address of the Docker registry where images should be pushed to.
func (*ProjectImages) WorkingDirectory ¶
func (pi *ProjectImages) WorkingDirectory() string
WorkingDirectory returns the absolute path of the working directory for the images of the project.
type ProjectManifests ¶
type ProjectManifests struct {
// contains filtered or unexported fields
}
ProjectManifests contains the information about the manifests that are part of the project.
func (*ProjectManifests) Directory ¶
func (pm *ProjectManifests) Directory() string
Directory returns the absolute path of the directory containing the source files of the OpenShift manifests.
func (*ProjectManifests) WorkingDirectory ¶
func (pm *ProjectManifests) WorkingDirectory() string
WorkingDirectory returns the absolute path of the working directory for the OpenShift manifests of the project.