Documentation ¶
Index ¶
- Constants
- func SortAppsByName(apps []*App)
- type App
- 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) Type() string
- func (d *DockerArtifact) UploadDestination() string
- func (d *DockerArtifact) UploadJob() (scheduler.Job, error)
- 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) Type() string
- func (f *FileArtifact) UploadDestination() string
- func (f *FileArtifact) UploadJob() (scheduler.Job, error)
- 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 UnresolvedInputs cfg.BuildInput // 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 ¶
BuildInputs resolves all build inputs of the app. The BuildInputs are deduplicates before they are returned. If one more resolved path does not match a file an error is generated. If not build inputs are defined, an empty slice and no error is returned. If the function is called the first time, the BuildInputPaths are resolved and stored. On following calls the stored BuildInputs are returned.
func (*App) HasBuildInputs ¶ added in v0.11.1
HasBuildInputs returns true if BuildInputs are defined for the app
type BuildOutput ¶
type BuildOutput interface { Exists() bool UploadJob() (scheduler.Job, error) Name() string String() string LocalPath() string UploadDestination() string Digest() (*digest.Digest, error) Size(*BuildOutputBackends) (int64, error) Type() string }
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 ¶
func GetBuildStatus(storer storage.Storer, app *App) (BuildStatus, *storage.BuildWithDuration, error)
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) Type ¶ added in v0.11.1
func (d *DockerArtifact) Type() string
Type returns "docker"
func (*DockerArtifact) UploadDestination ¶
func (d *DockerArtifact) UploadDestination() string
UploadDestination returns the upload destination
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 ¶
type FileArtifact struct { RelPath string Path string DestFile string UploadURL string // contains filtered or unexported fields }
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) Type ¶ added in v0.11.1
func (f *FileArtifact) Type() string
Type returns "file"
func (*FileArtifact) UploadDestination ¶
func (f *FileArtifact) UploadDestination() string
UploadDestination returns the upload destination
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
func (*RemoteDockerImg) URI ¶ added in v0.11.1
func (r *RemoteDockerImg) URI() string
URI returns <repository>/<path>@:<digest>
type Repository ¶
type Repository struct { Path string CfgPath string AppSearchDirs []string SearchDepth int PSQLURL string // contains filtered or unexported fields }
Repository represents an repository containing applications
func FindRepository ¶
func FindRepository(dir string) (*Repository, error)
FindRepository searches for a repository config file. The search starts in the passed directory and traverses the parent directory down to '/'. The first found repository configuration file is returned.
func FindRepositoryCwd ¶ added in v0.11.1
func FindRepositoryCwd() (*Repository, error)
FindRepositoryCwd 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 format outputs data in formatted table structures
|
Package format outputs data in formatted table structures |
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 |
scheduler/seq
Package seq implements a simple Sequential Uploader.
|
Package seq implements a simple Sequential Uploader. |