cli

package
v0.0.0-...-900fa13 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2015 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	APIRoot string

	User   string
	APIKey string
	// contains filtered or unexported fields
}

APIClient manages requests to the API server endpoints, and unmarshaling the results into usable structures.

func (*APIClient) CancelPatch

func (ac *APIClient) CancelPatch(patchId string) error

func (*APIClient) CheckUpdates

func (ac *APIClient) CheckUpdates() (*evergreen.ClientConfig, error)

CheckUpdates fetches information about available updates to client binaries from the server.

func (*APIClient) DeletePatchModule

func (ac *APIClient) DeletePatchModule(patchId, module string) error

DeletePatchModule makes a request to the API server to delete the given module from a patch

func (*APIClient) FinalizePatch

func (ac *APIClient) FinalizePatch(patchId string) error

func (*APIClient) GetPatches

func (ac *APIClient) GetPatches() ([]patch.Patch, error)

GetPatches requests a list of the user's patches from the API and returns them as a list

func (*APIClient) GetProjectRef

func (ac *APIClient) GetProjectRef(projectId string) (*model.ProjectRef, error)

GetProjectRef requests project details from the API server for a given project ID.

func (*APIClient) ListProjects

func (ac *APIClient) ListProjects() ([]model.ProjectRef, error)

func (*APIClient) PutPatch

func (ac *APIClient) PutPatch(incomingPatch patchSubmission) (*patch.Patch, error)

PutPatch submits a new patch for the given project to the API server. If successful, returns the patch object itself.

func (*APIClient) UpdatePatchModule

func (ac *APIClient) UpdatePatchModule(patchId, module, patch, base string) error

UpdatePatchModule makes a request to the API server to set a module patch on the given patch ID.

func (*APIClient) ValidateLocalConfig

func (ac *APIClient) ValidateLocalConfig(data []byte) ([]validator.ValidationError, error)

ValidateLocalConfig validates the local project config with the server

type APIError

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

APIError is an implementation of error for reporting unexpected results from API calls.

func NewAPIError

func NewAPIError(resp *http.Response) APIError

NewAPIError creates an APIError by reading the body of the response and its status code.

func (APIError) Error

func (ae APIError) Error() string

type CancelPatchCommand

type CancelPatchCommand struct {
	GlobalOpts Options `no-flag:"true"`
	PatchId    string  `short:"i" description:"id of the patch to modify" required:"true"`
}

CancelPatchCommand is used to cancel a patch.

func (*CancelPatchCommand) Execute

func (cpc *CancelPatchCommand) Execute(args []string) error

type FinalizePatchCommand

type FinalizePatchCommand struct {
	GlobalOpts Options `no-flag:"true"`
	PatchId    string  `short:"i" description:"id of the patch to modify" required:"true"`
}

FinalizePatchCommand is used to finalize a patch, allowing it to be scheduled.

func (*FinalizePatchCommand) Execute

func (fpc *FinalizePatchCommand) Execute(args []string) error

type GetUpdateCommand

type GetUpdateCommand struct {
	GlobalOpts Options `no-flag:"true"`
	Install    bool    `long:"install" description:"after downloading update, overwrite old binary with new one"`
}

GetUpdateCommand attempts to fetch the latest version of the client binary and install it over the current one.

func (*GetUpdateCommand) Execute

func (uc *GetUpdateCommand) Execute(args []string) error

type ListPatchesCommand

type ListPatchesCommand struct {
	GlobalOpts  Options  `no-flag:"true"`
	Variants    []string `short:"v" long:"variants" description:"variants to run the patch on. may be specified multiple times, or use the value 'all'"`
	PatchId     string   `short:"i" description:"show details for only the patch with this ID"`
	ShowSummary bool     `short:"s" long:"show-summary" description:"show a summary of the diff for each patch"`
}

ListPatchesCommand is used to list a user's existing patches.

func (*ListPatchesCommand) Execute

func (lpc *ListPatchesCommand) Execute(args []string) error

type ListProjectsCommand

type ListProjectsCommand struct {
	GlobalOpts Options `no-flag:"true"`
}

func (*ListProjectsCommand) Execute

func (lp *ListProjectsCommand) Execute(args []string) error

type Options

type Options struct {
	ConfFile string `short:"c" long:"config" description:"path to config file (defaults to ~/.evergreen.yml)"`
}

type PatchCommand

type PatchCommand struct {
	GlobalOpts  Options  `no-flag:"true"`
	Project     string   `short:"p" long:"project" description:"project to submit patch for"`
	Variants    []string `short:"v" long:"variants"`
	SkipConfirm bool     `short:"y" long:"yes" description:"skip confirmation text"`
	Description string   `short:"d" long:"description" description:"description of patch (optional)"`
	Finalize    bool     `short:"f" long:"finalize" description:"schedule tasks immediately"`
}

PatchCommand is used to submit a new patch to the API server.

func (*PatchCommand) Execute

func (pc *PatchCommand) Execute(args []string) error

type ProjectConf

type ProjectConf struct {
	Name     string   `yaml:"name,omitempty"`
	Default  bool     `yaml:"default,omitempty"`
	Variants []string `yaml:"variants,omitempty"`
}

type RemoveModuleCommand

type RemoveModuleCommand struct {
	GlobalOpts Options `no-flag:"true"`
	Module     string  `short:"m" long:"module" description:"name of the module to remove from patch" required:"true" `
	PatchId    string  `short:"i" description:"name of the module to remove from patch" required:"true" `
}

RemoveModuleCommand removes module information from an existing patch.

func (*RemoveModuleCommand) Execute

func (rmc *RemoveModuleCommand) Execute(args []string) error

type SetModuleCommand

type SetModuleCommand struct {
	GlobalOpts  Options `no-flag:"true"`
	Module      string  `short:"m" long:"module" description:"name of the module to set patch for"`
	PatchId     string  `short:"i" description:"id of the patch to modify" required:"true" `
	SkipConfirm bool    `short:"y" long:"yes" description:"skip confirmation text"`
}

SetModuleCommand adds or updates a module in an existing patch.

func (*SetModuleCommand) Execute

func (smc *SetModuleCommand) Execute(args []string) error

type Settings

type Settings struct {
	APIServerHost string        `yaml:"api_server_host,omitempty"`
	UIServerHost  string        `yaml:"ui_server_host,omitempty"`
	APIKey        string        `yaml:"api_key,omitempty"`
	User          string        `yaml:"user,omitempty"`
	Projects      []ProjectConf `yaml:"projects,omitempty"`
}

Settings represents the data stored in the user's config file, by default located at ~/.evergreen.yml

func (*Settings) FindDefaultProject

func (s *Settings) FindDefaultProject() string

func (*Settings) FindDefaultVariants

func (s *Settings) FindDefaultVariants(project string) []string

func (*Settings) SetDefaultProject

func (s *Settings) SetDefaultProject(name string)

func (*Settings) SetDefaultVariants

func (s *Settings) SetDefaultVariants(project string, variants ...string)

func (*Settings) Write

func (s *Settings) Write(opts Options) error

type ValidateCommand

type ValidateCommand struct {
	GlobalOpts Options `no-flag:"true"`
}

ValidateCommand is used to verify that a config file is valid.

func (*ValidateCommand) Execute

func (vc *ValidateCommand) Execute(args []string) error

type VersionCommand

type VersionCommand struct{}

VersionCommand prints the revision that the CLI binary was built with. Is used by auto-update to verify the new version.

func (*VersionCommand) Execute

func (vc *VersionCommand) Execute(args []string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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