cmd

package
v0.0.0-...-d195741 Latest Latest
Warning

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

Go to latest
Published: May 27, 2015 License: Apache-2.0 Imports: 26 Imported by: 0

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

View Source
const (
	CodeNoWorkingDir        = -2
	CodeMissingServerConfig = -3
	CodeMissingJobConfig    = -4
	CodeCannotDelete        = -5
	CodeMissingBranch       = -6
	CodeMissingRemoteOrigin = -7
	CodeCannotAddJob        = -8
)

Variables

View Source
var (
	ErrNoSbrfile = errors.New("Not in an 'sbr' workspace")
	ErrNoWd      = errors.New("Cannot find out the working dir")
)
View Source
var CIServerMd = `` /* 1729-byte string literal not displayed */
View Source
var SbrFormatMd = `` /* 4333-byte string literal not displayed */

Functions

func ExecConcurrently

func ExecConcurrently(x *sbr.Workspace, command string, args ...string) <-chan Execution

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)

func GetCIConf

func GetCIConf(prj string) (server, jobname 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 CilogCmd

type CilogCmd struct {
	// contains filtered or unexported fields
}

func (*CilogCmd) Flags

func (c *CilogCmd) Flags(fs *flag.FlagSet)

func (*CilogCmd) Run

func (c *CilogCmd) Run(args []string)

type CloneCmd

type CloneCmd struct {
	// contains filtered or unexported fields
}

func (*CloneCmd) Flags

func (c *CloneCmd) Flags(fs *flag.FlagSet)

func (*CloneCmd) Run

func (c *CloneCmd) Run(args []string)

type DaemonCmd

type DaemonCmd struct {
	// contains filtered or unexported fields
}

func (*DaemonCmd) Flags

func (c *DaemonCmd) Flags(fs *flag.FlagSet)

func (*DaemonCmd) Run

func (c *DaemonCmd) 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 DiffCmd

type DiffCmd struct {
	// contains filtered or unexported fields
}

func (*DiffCmd) Flags

func (d *DiffCmd) Flags(fs *flag.FlagSet)

func (*DiffCmd) Run

func (d *DiffCmd) Run(args []string)

type ExecCmd

type ExecCmd struct {
	// contains filtered or unexported fields
}

func (*ExecCmd) Flags

func (c *ExecCmd) Flags(fs *flag.FlagSet)

func (*ExecCmd) Run

func (c *ExecCmd) 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 FetchCmd

type FetchCmd struct {
}

func (*FetchCmd) Run

func (c *FetchCmd) Run(args []string)

type FormatCmd

type FormatCmd struct {
	// contains filtered or unexported fields
}

func (*FormatCmd) Flags

func (c *FormatCmd) Flags(fs *flag.FlagSet)

func (*FormatCmd) Run

func (c *FormatCmd) Run(args []string)

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

Tail returns changes between x (the assumed previous RemoteExecution) and 'n' the new one

type SbrCmd

type SbrCmd struct {
	command.Commander
}

func NewSbrCmd

func NewSbrCmd() SbrCmd

type StatusCmd

type StatusCmd struct {
	// contains filtered or unexported fields
}

func (*StatusCmd) Flags

func (c *StatusCmd) Flags(fs *flag.FlagSet)

func (*StatusCmd) Run

func (c *StatusCmd) Run(args []string)

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)

Jump to

Keyboard shortcuts

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