Documentation
¶
Index ¶
- func LocalBranches(workingDir string) []string
- func RemoteBranches(workingDir string) []string
- type MonoRepo
- func (m *MonoRepo) Add(p Project)
- func (m *MonoRepo) Clone() error
- func (m *MonoRepo) Exec(command string)
- func (m *MonoRepo) Fetch()
- func (m *MonoRepo) GetProject(name string) (Project, error)
- func (m *MonoRepo) RemoteBranches() []string
- func (m *MonoRepo) Remove() error
- func (m *MonoRepo) RemoveBranches(noLocal bool, noRemote bool)
- func (m *MonoRepo) SplitProject(p Project, branch string) string
- func (m *MonoRepo) Sync(branch string, useForce bool)
- func (m *MonoRepo) SyncTag(tag string, useForce bool)
- func (m *MonoRepo) WriteConfigFile(configFile string) error
- type Project
- type TemplateMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LocalBranches ¶ added in v0.3.0
LocalBranches returns a list of local branches
func RemoteBranches ¶ added in v0.3.0
RemoteBranches returns a list of all branches from the given git repository path
Types ¶
type MonoRepo ¶
type MonoRepo struct { Projects []Project `yaml:"projects"` OperatingDir string `yaml:"operating-directory"` }
func NewMonoRepo ¶
NewMonoRepo creates a new instance with the content from the given config file
func NewMonoRepoFromPath ¶
func NewMonoRepoFromPath(gitBaseUrl string, subtreeParentDirectory string, operatingDir string) *MonoRepo
NewMonoRepoFromPath will initialize all directories under a specified path as a sub-tree repository
func (*MonoRepo) Clone ¶
Clone will clone all repositories which are configured into the operating directory
func (*MonoRepo) GetProject ¶
GetProject returns a project by name, if no project was found it will return an error.
func (*MonoRepo) RemoteBranches ¶ added in v0.3.0
RemoteBranches returns a list of all branches on all remote mono repos
func (*MonoRepo) RemoveBranches ¶ added in v0.3.0
RemoveBranches removes all branches in subtree splits which do not exist in the remote mono repo
func (*MonoRepo) SplitProject ¶
SplitProject splits the project and returns the hash or branch name If no branch name is given it will only create a hash for the subtree
func (*MonoRepo) Sync ¶
Sync will create subtrees of all projects and create a branch for it after that it will be pushed to the remote destination
func (*MonoRepo) WriteConfigFile ¶
WriteConfigFile writes the content of the MonoRepo struct to a given config file
type Project ¶
type Project struct { Name string `yaml:"name"` // Path defines the path to the directory inside the mono repo Path string `yaml:"path"` // OperatingPath defines the path to the checked out repository, located in the mono-repos` operating dir OperatingPath string `yaml:"operating-path,omitempty"` GitUrl string `yaml:"git-url"` IsDir bool `yaml:"is-dir,omitempty"` }
type TemplateMetadata ¶ added in v0.5.0
type TemplateMetadata struct {
DirName string
}