Documentation ¶
Index ¶
- Constants
- Variables
- func AuthStore(baseDir string) (s *auth.Store, err error)
- func BuildinfoStore(baseDir string) (s buildinfostore.Store, err error)
- func ConvertToLines(output []byte) []string
- func CreatePlayground(opts PlaygroundOptions) error
- func DefaultAuthStore() (s *auth.Store, err error)
- func DefaultBuildinfoStore() (s buildinfostore.Store, err error)
- func DefaultFilestore() (s store.Store, err error)
- func DefaultNixBuilder() (_ *nixbuilder.NB, err error)
- func Filestore(dir string) (s store.Store, err error)
- func FprintCloneOutput(reponame string, output []byte, success bool) *bytes.Buffer
- func FprintRepoTitle(reponame string, maxlen int, success bool) *bytes.Buffer
- func MustDefaultBuildinfoStore() buildinfostore.Store
- func MustDefaultFilestore() store.Store
- func Name(repoURL string) (name string)
- func NewBuilder(task string, aggregate *bobfile.Bobfile, f BuildFunc, nix *nixbuilder.NB) ctl.Builder
- func NixBuilder(baseDir string) (_ *nixbuilder.NB, err error)
- func RepoName(repoURL *url.URL) (name string)
- type B
- func (b *B) Add(rawurl string, plain bool) (err error)
- func (b *B) Aggregate() (aggregate *bobfile.Bobfile, err error)
- func (b *B) AggregateSparse(omitRunTasks ...bool) (aggregate *bobfile.Bobfile, err error)
- func (b *B) AggregateWithNixDeps(taskName string) (aggregate *bobfile.Bobfile, err error)
- func (b *B) ArtifactInspect(artifactID string) (ai bobtask.ArtifactInfo, err error)
- func (b *B) ArtifactList(ctx context.Context) (description string, err error)
- func (b *B) AuthContext(name string) (authCtx auth.Context, err error)
- func (b *B) AuthContexts() ([]auth.Context, error)
- func (b *B) Build(ctx context.Context, taskName string) (err error)
- func (b B) Clean() (err error)
- func (b B) CleanBuildInfoStore() error
- func (b B) CleanLocalStore() error
- func (b B) CleanNixCache() error
- func (b B) CleanNixShellCache() error
- func (b *B) Clone(failFast bool, preferedProtocol ...string) (err error)
- func (b *B) CloneRepo(repoURL string, failFast bool) (_ string, err error)
- func (b *B) CreateAuthContext(name, token string) (err error)
- func (b *B) CurrentAuthContext() (curr auth.Context, err error)
- func (b *B) DeleteAuthContext(name string) (err error)
- func (b *B) Dir() string
- func (b *B) GetBuildTasks() (tasks []string, err error)
- func (b *B) GetRunTasks() (tasks []string, err error)
- func (b *B) Init() (err error)
- func (b B) Install() (err error)
- func (b *B) Localstore() store.Store
- func (b *B) Nix() *nixbuilder.NB
- func (b *B) PrintVersionCompatibility(bobfile *bobfile.Bobfile)
- func (b *B) RepositoryNames() (names []string, err error)
- func (b *B) Run(ctx context.Context, runTaskName string) (_ ctl.Commander, err error)
- func (b *B) SetCurrentAuthContext(name string) (err error)
- func (b *B) UpdateAuthContext(name string, token string) (err error)
- func (b *B) Verify(ctx context.Context) (err error)
- func (b B) WorkspaceFilePath() string
- type BuildFunc
- type CloneSchema
- type GitProvider
- type GitRepo
- type GitURL
- type Option
- func WithAuthStore(store *auth.Store) Option
- func WithBuildinfoStore(store buildinfostore.Store) Option
- func WithCachingEnabled(enabled bool) Option
- func WithDir(dir string) Option
- func WithEnvVariables(env []string) Option
- func WithFilestore(store store.Store) Option
- func WithInsecure(allow bool) Option
- func WithMaxParallel(maxParallel int) Option
- func WithNixBuilder(nix *nixbuilder.NB) Option
- func WithPullEnabled(enabled bool) Option
- func WithPushEnabled(enabled bool) Option
- func WithRemotestore(store store.Store) Option
- func WithRequireBobConfig() Option
- type Parser
- type Parsers
- type PlaygroundOptions
- type Repo
Constants ¶
const ( BuildAllTargetName = "all" BuildTargetwithdirsTargetName = "targetwithdirs" BuildAlwaysTargetName = "always-build" BuildTargetDockerImageName = "docker-image" BuildTargetDockerImagePlusName = "docker-image-plus" // BuildTargetBobTestImage intentionaly has a path separator // in the image name to assure temporary tar archive generation // works as intended (uses the image name as filename). BuildTargetBobTestImage = "bob/testimage:latest" BuildTargetBobTestImagePlus = "bob/testimage/plus:latest" )
const SecondLevelDir = "second-level"
const SecondLevelOpenapiProviderDir = "openapi-provider-project"
const ThirdLevelDir = "third-level"
Variables ¶
var ( ErrConfigFileDoesNotExist = fmt.Errorf("config file does not exist") ErrRepoAlreadyAdded = fmt.Errorf("repo already added") ErrRunDoesNotExist = fmt.Errorf("run does not exist") ErrWorkspaceAlreadyInitialised = fmt.Errorf("bob Workspace Already Initialized") ErrTargetValidationFailed = fmt.Errorf("target validation failed") ErrCouldNotFindTopLevelBobfile = fmt.Errorf("could not find top-level Bobfile") ErrInvalidVersion = fmt.Errorf("invalid version") ErrInsecuredHTTPURL = fmt.Errorf("insecured http url not supported") ErrInvalidScheme = fmt.Errorf("invalid scheme") ErrInvalidGitUrl = fmt.Errorf("invalid git url") ErrInvalidRepositoryName = fmt.Errorf("invalid repository name") )
var (
ErrDuplicateProjectName = fmt.Errorf("duplicate project name")
)
var (
ErrNoRebuildRequired = errors.New("no rebuild required")
)
var ErrNoValidURLToClone = fmt.Errorf("No valid URL to clone found.")
var Version = "0.0.0"
Functions ¶
func BuildinfoStore ¶
func BuildinfoStore(baseDir string) (s buildinfostore.Store, err error)
func ConvertToLines ¶
ConvertToLines converts bytes into a list of strings separeted by newline
func CreatePlayground ¶
func CreatePlayground(opts PlaygroundOptions) error
CreatePlayground creates a default playground to test bob workflows. projectName is used in the top-level bobfile
func DefaultAuthStore ¶
func DefaultBuildinfoStore ¶
func DefaultBuildinfoStore() (s buildinfostore.Store, err error)
func DefaultFilestore ¶
func DefaultNixBuilder ¶
func DefaultNixBuilder() (_ *nixbuilder.NB, err error)
func FprintCloneOutput ¶
FprintCloneOutput returns formatted output buffer with repository title from git clone output.
func FprintRepoTitle ¶
FprintRepoTitle returns repo title buffer with success/error label
func MustDefaultBuildinfoStore ¶
func MustDefaultBuildinfoStore() buildinfostore.Store
func MustDefaultFilestore ¶
func NewBuilder ¶
func NixBuilder ¶
func NixBuilder(baseDir string) (_ *nixbuilder.NB, err error)
NixBuilder initialises a new nix builder object with the cache setup in the given location.
It's save to use the same base dir as for BuildinfoStore(), Filestore() and AuthStore().
Types ¶
type B ¶
type B struct { // Repositories to track. Repositories []Repo `yaml:"repositories"` // contains filtered or unexported fields }
func BobWithBaseStoreDir ¶
BobWithBaseStoreDir initialises stores in the given directory
func (*B) Add ¶
Add, adds a repositoroy to a workspace.
Automatically tries to guess the contrary url (git@/https://) from the given rawurl. This behavior can be deactivated if plain is set to true. In case of a local path (file://) plain has no effect.
func (*B) Aggregate ¶
Aggregate determine and read Bobfiles recursively into memory and returns a single Bobfile containing all tasks & runs.
func (*B) AggregateSparse ¶
AggregateSparse reads Bobfile with the intent to gather task names. The returned bobfile is not ready to be executed with a playbook.
func (*B) AggregateWithNixDeps ¶
AggregateWithNixDeps does aggregation together with evaluating nix dependecies. Nic dependencies are altering a tasks input hash. Use this function for building `bob inspect` cmds.
func (*B) ArtifactInspect ¶
func (b *B) ArtifactInspect(artifactID string) (ai bobtask.ArtifactInfo, err error)
func (*B) ArtifactList ¶
ArtifactList list artifacts belonging to each tasks. Artifacts are matched by project & taskname as well as their input hash stored in the artifacts metadata if required.
func (B) CleanBuildInfoStore ¶
func (B) CleanLocalStore ¶
func (B) CleanNixCache ¶
func (B) CleanNixShellCache ¶
func (*B) Clone ¶
Clone repos which are not yet in the workspace. Uses priority urls ssh >> https >> file.
failFast will not prompt the user in case of an error. preferedProtocol accepts https or ssh.
TODO: it still happens that git prompts for user input in case of a missing password on https.
func (*B) CloneRepo ¶
CloneRepo repo and sub repositories recursively. failFast will not prompt the user in case of an error.
func (*B) CreateAuthContext ¶
func (*B) DeleteAuthContext ¶
func (*B) GetBuildTasks ¶
func (*B) GetRunTasks ¶
func (*B) Localstore ¶
Localstore returns the local artifact store
func (*B) Nix ¶
func (b *B) Nix() *nixbuilder.NB
func (*B) PrintVersionCompatibility ¶
func (*B) RepositoryNames ¶
func (*B) Run ¶
Run builds dependent tasks for a run cmd and starts it. A control is returned to interact with the run cmd.
Canceling the cmd from the outside must be done through the context.
FIXME: Forbid circular dependecys.
func (*B) SetCurrentAuthContext ¶
func (B) WorkspaceFilePath ¶
type CloneSchema ¶
type CloneSchema string
const ( SSH CloneSchema = "ssh" HTTPS CloneSchema = "https" )
func (*CloneSchema) String ¶
func (cs *CloneSchema) String() string
type GitProvider ¶
type GitRepo ¶
type GitRepo struct { Provider GitProvider // SSH stores git@ SSH *GitURL // HTTPS stores https:// HTTPS *GitURL // Local stores file:// Local string }
func Parse ¶
Parse a rawurl and return a GitRepo object containing the specific https and ssh protocol urls.
func ParseAzure ¶
ParseAzure parses a git repo url and return the corresponding git & https protocol links corresponding to azure-devops domain specifications. https://xxx@dev.azure.com/xxx/Yyy/_git/zzz.zzz.zzz", git@ssh.dev.azure.com:v3/xxx/Yyy/zzz.zzz.zzz",
func ParseGeneral ¶
ParseGeneral parses a git repo url and return the corresponding git & https protocol links corresponding to most (github, gitlab) domain specifications.
github https://github.com/benchkram/bob.git git@github.com:benchkram/bob.git gitlab git@gitlab.com:gitlab-org/gitlab.git https://gitlab.com/gitlab-org/gitlab.git
func ParseLocal ¶
type Option ¶
type Option func(b *B)
func WithAuthStore ¶
func WithBuildinfoStore ¶
func WithBuildinfoStore(store buildinfostore.Store) Option
func WithCachingEnabled ¶
func WithEnvVariables ¶
func WithFilestore ¶
func WithInsecure ¶
func WithMaxParallel ¶
func WithNixBuilder ¶
func WithNixBuilder(nix *nixbuilder.NB) Option
func WithPullEnabled ¶
func WithPushEnabled ¶
func WithRemotestore ¶
func WithRequireBobConfig ¶
func WithRequireBobConfig() Option
WithRequireBobConfig forces bob to read the configuration from `.bob/config`. Currently only used by `bob clone` and `bob git ...
type PlaygroundOptions ¶
Source Files ¶
- add.go
- aggregate.go
- aggregate_util.go
- artifact.go
- auth.go
- bob.go
- bob_defaults.go
- build.go
- build_list.go
- builder.go
- clean.go
- clone.go
- clone_schema.go
- config.go
- error.go
- gitignore.go
- init.go
- install.go
- options.go
- playground.go
- playground_compose.go
- repo.go
- repo_provider.go
- run.go
- run_list.go
- verify.go