Documentation ¶
Overview ¶
Package cmd contains all the commands defined in the 'sbr' main program.
*Cmd implements the Rakyll's github.com/rakyll/command.Cmd interface
Index ¶
- Constants
- Variables
- func ExecConcurrently(x *sbr.Workspace, command string, args ...string) <-chan Execution
- func ExecutionCat(source <-chan Execution)
- func ExecutionCount(source <-chan Execution)
- func ExecutionDigest(source <-chan Execution)
- func ExecutionPrinter(source <-chan Execution)
- func ExecutionSum(source <-chan Execution)
- func FindRootCmd() (dir string)
- func GetCIConf(prj string) (server, jobname string)
- type CheckoutCmd
- type CilogCmd
- type CloneCmd
- type DaemonCmd
- type DashboardCmd
- type DiffCmd
- type ExecCmd
- type Execution
- type ExecutionProcessor
- type FetchCmd
- type FormatCmd
- type RemoteExecution
- type SbrCmd
- type StatusCmd
- type SubscribeCmd
- type VersionCmd
Constants ¶
const ( CodeNoWorkingDir = -2 CodeMissingServerConfig = -3 CodeMissingJobConfig = -4 CodeCannotDelete = -5 CodeMissingBranch = -6 CodeMissingRemoteOrigin = -7 CodeCannotAddJob = -8 )
Variables ¶
var ( ErrNoSbrfile = errors.New("Not in an 'sbr' workspace") ErrNoWd = errors.New("Cannot find out the working dir") )
var CIServerMd = `` /* 1729-byte string literal not displayed */
var SbrFormatMd = `` /* 4333-byte string literal not displayed */
Functions ¶
func ExecConcurrently ¶
ExecConcurently, for each `subrepository` in the working dir, execute the command `command` with arguments `args`. Each command is executed in non interactive mode (no access to stdin/stdout)
func ExecutionCat ¶
func ExecutionCat(source <-chan Execution)
ExecutionCat ExecutionProcessor `cat` together all outputs.
func ExecutionCount ¶
func ExecutionCount(source <-chan Execution)
ExecutionCount counts different outputs
func ExecutionDigest ¶
func ExecutionDigest(source <-chan Execution)
ExecutionDigest computes the digest of all execution results concatenated. Outputs are trimed of whitespaces. (` \n\r\t`)
func ExecutionPrinter ¶
func ExecutionPrinter(source <-chan Execution)
ExecutionPrinter just print a colored header and the result
func ExecutionSum ¶
func ExecutionSum(source <-chan Execution)
ExecutionSum attempt to parse the Execution result as a number and sum it up. if it can parse it as a number it uses `NaN`.
func FindRootCmd ¶
func FindRootCmd() (dir string)
Types ¶
type CheckoutCmd ¶
type CheckoutCmd struct {
// contains filtered or unexported fields
}
func (*CheckoutCmd) Flags ¶
func (c *CheckoutCmd) Flags(fs *flag.FlagSet)
func (*CheckoutCmd) Run ¶
func (c *CheckoutCmd) Run(args []string)
type DashboardCmd ¶
type DashboardCmd struct {
// contains filtered or unexported fields
}
func (*DashboardCmd) Flags ¶
func (c *DashboardCmd) Flags(fs *flag.FlagSet)
func (*DashboardCmd) Run ¶
func (c *DashboardCmd) Run(args []string)
type Execution ¶
type Execution struct { Name string Rel string // relative path to the root Cmd string Args []string Result string }
Execution is the result of a command Execution on a given project You get the project's name (the full path to the repository )
type ExecutionProcessor ¶
type ExecutionProcessor func(<-chan Execution)
ExecutionProcessor is a function that should process executions from the given chan
type RemoteExecution ¶
type RemoteExecution struct {
// contains filtered or unexported fields
}
RemoteExecution represent a remote execution, either refresh or build
func GetRemoteExecution ¶
func GetRemoteExecution(remoteurl string, req *format.Request) (b, r *RemoteExecution)
GetRemoteExecution makes the query on the ci server to get refresh and build information. It transforms them into RemoteExecution
func NewRemoteExecution ¶
func NewRemoteExecution(px *format.Execution, name string) *RemoteExecution
NewRemoteExecution transform a format.Execution into a friendly RemoteExecution
func (*RemoteExecution) Done ¶
func (x *RemoteExecution) Done() bool
Done returns true when the execution is done
func (*RemoteExecution) Print ¶
func (x *RemoteExecution) Print() string
Print returns a terminal friendly string representation of the current execution
func (*RemoteExecution) Since ¶
func (x *RemoteExecution) Since() time.Duration
func (*RemoteExecution) StartAfter ¶
func (x *RemoteExecution) StartAfter(z *RemoteExecution) bool
func (*RemoteExecution) Summary ¶
func (x *RemoteExecution) Summary() string
Summary returns a small summary of the execution (status, duration and time since ended)
func (*RemoteExecution) Tail ¶
func (x *RemoteExecution) Tail(n *RemoteExecution) string
Tail returns changes between x (the assumed previous RemoteExecution) and 'n' the new one
type SubscribeCmd ¶
type SubscribeCmd struct {
// contains filtered or unexported fields
}
func (*SubscribeCmd) Flags ¶
func (c *SubscribeCmd) Flags(fs *flag.FlagSet)
func (*SubscribeCmd) Run ¶
func (c *SubscribeCmd) Run(args []string)
type VersionCmd ¶
type VersionCmd struct{}
func (*VersionCmd) Run ¶
func (c *VersionCmd) Run(args []string)