Documentation ¶
Index ¶
- Constants
- func SortAppsByName(apps []*App)
- type App
- type BuildInput
- type BuildInputPathResolver
- type BuildOutput
- type BuildOutputBackends
- type BuildStatus
- type DockerArtifact
- func (d *DockerArtifact) Digest() (*digest.Digest, error)
- func (d *DockerArtifact) Exists() bool
- func (d *DockerArtifact) ImageID() (string, error)
- func (d *DockerArtifact) LocalPath() string
- func (d *DockerArtifact) Name() string
- func (d *DockerArtifact) Size(b *BuildOutputBackends) (int64, error)
- func (d *DockerArtifact) String() string
- func (d *DockerArtifact) UploadDestination() string
- func (d *DockerArtifact) UploadJob() (upload.Job, error)
- type DockerImageRef
- type File
- type FileArtifact
- func (f *FileArtifact) Digest() (*digest.Digest, error)
- func (f *FileArtifact) Exists() bool
- func (f *FileArtifact) LocalPath() string
- func (f *FileArtifact) Name() string
- func (f *FileArtifact) Size(_ *BuildOutputBackends) (int64, error)
- func (f *FileArtifact) String() string
- func (f *FileArtifact) UploadDestination() string
- func (f *FileArtifact) UploadJob() (upload.Job, error)
- type FileGlobPath
- type GitPaths
- type GoSrcDirs
- type RemoteDockerImg
- type Repository
Constants ¶
const AppCfgFile = ".app.toml"
AppCfgFile contains the name of application configuration files
const RepositoryCfgFile = ".baur.toml"
RepositoryCfgFile contains the name of the repository configuration file.
Variables ¶
This section is empty.
Functions ¶
func SortAppsByName ¶
func SortAppsByName(apps []*App)
SortAppsByName sorts the apps in the slice by Name
Types ¶
type App ¶
type App struct { RelPath string Path string Name string BuildCmd string Repository *Repository Outputs []BuildOutput BuildInputPaths []BuildInputPathResolver // contains filtered or unexported fields }
App represents an application
func NewApp ¶
func NewApp(repository *Repository, cfgPath string) (*App, error)
NewApp reads the configuration file and returns a new App
func (*App) BuildInputs ¶
func (a *App) BuildInputs() ([]BuildInput, error)
BuildInputs returns all BuildInputs. If the function is called the first time, the BuildInputPaths are resolved and stored. On following calls the stored BuildInputs are returned.
type BuildInput ¶
BuildInput represents an input object of an application build, can be source files, compiler binaries etc, everything that can influence the produced build output
type BuildInputPathResolver ¶
type BuildInputPathResolver interface {
Resolve() ([]BuildInput, error)
}
BuildInputPathResolver is an interface to resolve abstract paths like file glob paths to concrete values (files)
type BuildOutput ¶
type BuildOutput interface { Exists() bool UploadJob() (upload.Job, error) Name() string String() string LocalPath() string UploadDestination() string Digest() (*digest.Digest, error) Size(*BuildOutputBackends) (int64, error) }
BuildOutput is an interface for build artifacts
type BuildOutputBackends ¶
BuildOutputBackends contains a list of backends that are required to interact with artifacts
type BuildStatus ¶
type BuildStatus int
BuildStatus indicates if build for a current application version exist
const ( // BuildStatusInputsUndefined inputs of the application are undefined, BuildStatusInputsUndefined BuildStatus // BuildStatusExist a build exist BuildStatusExist // BuildStatusOutstanding no build exist BuildStatusOutstanding )
func GetBuildStatus ¶
GetBuildStatus calculates the total input digest of the app and checks in the storage if a build for this input digest already exist. If the function returns BuildStatusExist the returned build pointer is valid otherwise it is nil.
func (BuildStatus) String ¶
func (b BuildStatus) String() string
type DockerArtifact ¶
DockerArtifact is a docker container artifact
func (*DockerArtifact) Digest ¶
func (d *DockerArtifact) Digest() (*digest.Digest, error)
Digest returns the image ID as Digest object
func (*DockerArtifact) Exists ¶
func (d *DockerArtifact) Exists() bool
Exists returns true if the ImageIDFile exists
func (*DockerArtifact) ImageID ¶
func (d *DockerArtifact) ImageID() (string, error)
ImageID reads the image from ImageIDFile
func (*DockerArtifact) LocalPath ¶
func (d *DockerArtifact) LocalPath() string
LocalPath returns the local path to the artifact
func (*DockerArtifact) Name ¶
func (d *DockerArtifact) Name() string
Name returns the docker repository name
func (*DockerArtifact) Size ¶
func (d *DockerArtifact) Size(b *BuildOutputBackends) (int64, error)
Size returns the size of the docker image in bytes
func (*DockerArtifact) String ¶
func (d *DockerArtifact) String() string
String returns the absolute path to the ImageID file
func (*DockerArtifact) UploadDestination ¶
func (d *DockerArtifact) UploadDestination() string
UploadDestination returns the upload destination
type DockerImageRef ¶
DockerImageRef represents a DockerSource entry
func (*DockerImageRef) Resolve ¶
func (d *DockerImageRef) Resolve() ([]BuildInput, error)
Resolve resolves the DockerImageRef to a RemoteDockerImg instance
type File ¶
type File struct {
// contains filtered or unexported fields
}
File represent a file
func (*File) RepoRelPath ¶
RepoRelPath returns the path relative to the baur repository
type FileArtifact ¶
FileArtifact is a file build artifact
func (*FileArtifact) Digest ¶
func (f *FileArtifact) Digest() (*digest.Digest, error)
Digest returns the file digest
func (*FileArtifact) Exists ¶
func (f *FileArtifact) Exists() bool
Exists returns true if the artifact exist
func (*FileArtifact) LocalPath ¶
func (f *FileArtifact) LocalPath() string
LocalPath returns the local path to the artifact
func (*FileArtifact) Name ¶
func (f *FileArtifact) Name() string
Name returns the path to the artifact relatively to application dir
func (*FileArtifact) Size ¶
func (f *FileArtifact) Size(_ *BuildOutputBackends) (int64, error)
Size returns the size of the file in bytes
func (*FileArtifact) String ¶
func (f *FileArtifact) String() string
String returns the String representation
func (*FileArtifact) UploadDestination ¶
func (f *FileArtifact) UploadDestination() string
UploadDestination returns the upload destination
type FileGlobPath ¶
type FileGlobPath struct {
// contains filtered or unexported fields
}
FileGlobPath is Source file of an application represented by a glob path
func NewFileGlobPath ¶
func NewFileGlobPath(repositoryRootPath, relAppPath, glob string) *FileGlobPath
NewFileGlobPath returns a new FileGlobPath object
func (*FileGlobPath) Resolve ¶
func (f *FileGlobPath) Resolve() ([]BuildInput, error)
Resolve returns a list of files that are matching the glob path of the FileGlobPath
type GitPaths ¶
type GitPaths struct {
// contains filtered or unexported fields
}
GitPaths resolves multiple git filepath patterns to paths in the filesystem.
func NewGitPaths ¶
NewGitPaths returns a new GitPaths
func (*GitPaths) Resolve ¶
func (g *GitPaths) Resolve() ([]BuildInput, error)
Resolve returns a list of files that are matching it's path
type GoSrcDirs ¶
type GoSrcDirs struct {
// contains filtered or unexported fields
}
GoSrcDirs resolves Golang source files in directories to files including resolving all imports to files
func NewGoSrcDirs ¶
NewGoSrcDirs returns a GoSrcDirs
func (*GoSrcDirs) Resolve ¶
func (g *GoSrcDirs) Resolve() ([]BuildInput, error)
Resolve returns list of Go src files
type RemoteDockerImg ¶
type RemoteDockerImg struct {
// contains filtered or unexported fields
}
RemoteDockerImg represents a docker image in a docker repository
func NewRemoteDockerImg ¶
func NewRemoteDockerImg(repository, digest string) *RemoteDockerImg
NewRemoteDockerImg creates a RemoteDockerImg
func (*RemoteDockerImg) Digest ¶
func (r *RemoteDockerImg) Digest() (digest.Digest, error)
Digest returns the image digest
func (*RemoteDockerImg) String ¶
func (r *RemoteDockerImg) String() string
String returns a string representation
type Repository ¶
type Repository struct { Path string CfgPath string AppSearchDirs []string SearchDepth int DefaultBuildCmd string PSQLURL string // contains filtered or unexported fields }
Repository represents an repository containing applications
func FindRepository ¶
func FindRepository() (*Repository, error)
FindRepository searches for a repository config file in the current directory and all it's parents. If a repository config file is found it returns a Repository
func NewRepository ¶
func NewRepository(cfgPath string) (*Repository, error)
NewRepository reads the configuration file and returns a Repository
func (*Repository) AppByDir ¶
func (r *Repository) AppByDir(appDir string) (*App, error)
AppByDir reads an application config file from the direcory and returns an App
func (*Repository) AppByName ¶
func (r *Repository) AppByName(name string) (*App, error)
AppByName searches for an App with the given name in the repository and returns it. If none is found os.ErrNotExist is returned.
func (*Repository) FindApps ¶
func (r *Repository) FindApps() ([]*App, error)
FindApps searches for application config files in the AppSearchDirs of the repository and returns all found apps
func (*Repository) GitCommitID ¶
func (r *Repository) GitCommitID() (string, error)
GitCommitID returns the Git commit ID in the baur repository root
func (*Repository) GitWorkTreeIsDirty ¶
func (r *Repository) GitWorkTreeIsDirty() (bool, error)
GitWorkTreeIsDirty returns true if the git repository contains untracked changes
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
seq
Package seq provides a sequential builder.
|
Package seq provides a sequential builder. |
cmd
|
|
Package golang determines all Go Source files that are imported by a Go-Files in a directory.
|
Package golang determines all Go Source files that are imported by a Go-Files in a directory. |
testutils
|
|
fstest
Package fstest provides test utilties to operate with files and directories
|
Package fstest provides test utilties to operate with files and directories |
strtest
Package strtest provides test utilties to operate with strings
|
Package strtest provides test utilties to operate with strings |
seq
Package seq implements a simple Sequential Uploader.
|
Package seq implements a simple Sequential Uploader. |