Documentation
¶
Index ¶
- func GenerateOutputImageLabels(info *api.SourceInfo, config *api.Config) map[string]string
- func IncludesRootUserDirective(directives []string) bool
- func IsPotentialRootUser(user string) bool
- func ReadEnvironmentFile(path string) (map[string]string, error)
- type CallbackInvoker
- type CommandOpts
- type CommandRunner
- type FileSystem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateOutputImageLabels ¶ added in v1.0.2
GenerateOutputImageLabels generate the labels based on the source repository informations.
func IncludesRootUserDirective ¶ added in v1.0.2
IncludesRootUserDirective takes a list of Dockerfile instructions and returns true if they include one with a "USER" directive and the specified user is a potential root user
func IsPotentialRootUser ¶ added in v1.0.2
IsPotentialRootUser will return true if the passed in user is blank, non-numeric, OR it's numeric and == 0
func ReadEnvironmentFile ¶
ReadEnvironmentFile reads the content for a file that contains a list of environment variables and values. The key-pairs are separated by a new line character. The file can also have comments (both '#' and '//' are supported).
Types ¶
type CallbackInvoker ¶
type CallbackInvoker interface {
ExecuteCallback(callbackURL string, success bool, messages []string) []string
}
CallbackInvoker posts results to a callback URL when a STI build is done.
func NewCallbackInvoker ¶
func NewCallbackInvoker() CallbackInvoker
NewCallbackInvoker creates an instance of the default CallbackInvoker implementation
type CommandOpts ¶
CommandOpts contains options to attach Stdout/err to a command to run or set its initial directory
type CommandRunner ¶
type CommandRunner interface {
RunWithOptions(opts CommandOpts, name string, arg ...string) error
Run(name string, arg ...string) error
}
CommandRunner executes OS commands with the given parameters and options
func NewCommandRunner ¶
func NewCommandRunner() CommandRunner
NewCommandRunner creates a new instance of the default implementation of CommandRunner
type FileSystem ¶
type FileSystem interface {
Chmod(file string, mode os.FileMode) error
Rename(from, to string) error
MkdirAll(dirname string) error
Mkdir(dirname string) error
Exists(file string) bool
Copy(sourcePath, targetPath string) error
RemoveDirectory(dir string) error
CreateWorkingDirectory() (string, error)
Open(file string) (io.ReadCloser, error)
WriteFile(file string, data []byte) error
ReadDir(string) ([]os.FileInfo, error)
Stat(string) (os.FileInfo, error)
}
FileSystem allows STI to work with the file system and perform tasks such as creating and deleting directories
func NewFileSystem ¶
func NewFileSystem() FileSystem
NewFileSystem creates a new instance of the default FileSystem implementation