operator

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MonoRepo

type MonoRepo struct {
	Projects     []Project `yaml:"projects"`
	OperatingDir string    `yaml:"operating-directory"`
}

func NewMonoRepo

func NewMonoRepo(config 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) ExecOnProject

func (m *MonoRepo) ExecOnProject(p Project, command string)

ExecOnProject executes a command on a single project

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) Remove added in v0.2.0

func (m *MonoRepo) Remove() error

Remove removes the operating directory

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) 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   string `yaml:"path"`
	GitUrl string `yaml:"git-url"`
}

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

Jump to

Keyboard shortcuts

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