operator

package
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LocalBranches added in v0.3.0

func LocalBranches(workingDir string) []string

LocalBranches returns a list of local branches

func RemoteBranches added in v0.3.0

func RemoteBranches(workingDir string) []string

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"`
	ProtectedBranches []string  `yaml:"protected-branches,omitempty"`
}

func NewMonoRepo

func NewMonoRepo(configPath string) (*MonoRepo, error)

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) Add

func (m *MonoRepo) Add(p Project)

Add adds a new project to the mono repo

func (*MonoRepo) Clone

func (m *MonoRepo) Clone() error

Clone will clone all repositories which are configured into the operating directory

func (*MonoRepo) Exec

func (m *MonoRepo) Exec(command string)

Exec executes a command on all subrepos

func (*MonoRepo) Fetch added in v0.3.0

func (m *MonoRepo) Fetch()

func (*MonoRepo) GetProject

func (m *MonoRepo) GetProject(name string) (Project, error)

GetProject returns a project by name, if no project was found it will return an error.

func (*MonoRepo) RemoteBranches added in v0.3.0

func (m *MonoRepo) RemoteBranches() []string

RemoteBranches returns a list of all branches on all remote mono repos

func (*MonoRepo) Remove added in v0.2.0

func (m *MonoRepo) Remove() error

Remove removes the operating directory

func (*MonoRepo) RemoveBranches added in v0.3.0

func (m *MonoRepo) RemoveBranches(noLocal bool, noRemote bool)

RemoveBranches removes all branches in subtree splits which do not exist in the remote mono repo

func (*MonoRepo) SplitProject

func (m *MonoRepo) SplitProject(p Project, branch string) string

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

func (m *MonoRepo) Sync(branch string, useForce bool)

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) SyncTag added in v0.4.0

func (m *MonoRepo) SyncTag(tag string, useForce bool)

func (*MonoRepo) WriteConfigFile

func (m *MonoRepo) WriteConfigFile(configFile string) error

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"`
}

func (*Project) Exec added in v0.3.0

func (p *Project) Exec(command string)

Exec executes a command inside the project's directory

func (*Project) GitClone

func (p *Project) GitClone(dest string) error

GitClone clones the project into the given destination path

func (*Project) Lock

func (p *Project) Lock() error

Lock will lock a project for specific tasks

func (*Project) Unlock

func (p *Project) Unlock()

Unlock unlocks the repo

type TemplateMetadata added in v0.5.0

type TemplateMetadata struct {
	DirName string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL