cmd

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2018 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GKE      string = "gke"
	EKS      string = "eks"
	AKS      string = "aks"
	MINIKUBE string = "minikube"
)
View Source
const (
	JX_GIT_TOKEN                   = "JX_GIT_TOKEN"
	JX_GIT_USER                    = "JX_GIT_USER"
	JX_GIT_PASSWORD                = "JX_GIT_PASSWORD"
	DEFAULT_CLOUD_ENVIRONMENTS_URL = "https://github.com/jenkins-x/cloud-environments"
)
View Source
const (
	DefaultWritePermissions = 0760
)

Variables

View Source
var KUBERNETES_PROVIDERS = map[string]bool{
	GKE:      true,
	EKS:      true,
	AKS:      true,
	MINIKUBE: true,
}

Functions

func GetDeploymentNames added in v1.0.2

func GetDeploymentNames(client *kubernetes.Clientset, ns string) ([]string, error)

TODO move to kube/deployments.go when jrawlings merges his stuff install...

func GetNamespaceNames added in v1.0.2

func GetNamespaceNames(client *kubernetes.Clientset) ([]string, error)

GetNamespaceNames returns the sorted list of environment names

func NewCmdCompletion added in v1.0.2

func NewCmdCompletion(f cmdutil.Factory, out io.Writer) *cobra.Command

func NewCmdConsole

func NewCmdConsole(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command

func NewCmdCreate added in v1.0.2

func NewCmdCreate(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command

NewCmdCreate creates a command object for the "create" command

func NewCmdCreateArchetype added in v1.0.2

func NewCmdCreateArchetype(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command

NewCmdCreateArchetype creates a command object for the "create" command

func NewCmdCreateCluster added in v1.0.2

func NewCmdCreateCluster(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command

NewCmdGet creates a command object for the generic "init" action, which installs the dependencies required to run the jenkins-x platform on a kubernetes cluster.

func NewCmdCreateClusterAKS added in v1.0.2

func NewCmdCreateClusterAKS(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command

NewCmdGet creates a command object for the generic "init" action, which installs the dependencies required to run the jenkins-x platform on a kubernetes cluster.

func NewCmdCreateClusterGKE added in v1.0.2

func NewCmdCreateClusterGKE(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command

NewCmdGet creates a command object for the generic "init" action, which installs the dependencies required to run the jenkins-x platform on a kubernetes cluster.

func NewCmdCreateClusterMinikube added in v1.0.2

func NewCmdCreateClusterMinikube(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command

NewCmdGet creates a command object for the generic "init" action, which installs the dependencies required to run the jenkins-x platform on a kubernetes cluster.

func NewCmdCreateEnv added in v1.0.2

func NewCmdCreateEnv(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command

NewCmdCreateEnv creates a command object for the "create" command

func NewCmdCreateSpring added in v1.0.2

func NewCmdCreateSpring(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command

NewCmdCreateSpring creates a command object for the "create" command

func NewCmdEdit added in v1.0.2

func NewCmdEdit(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command

NewCmdEdit creates the edit command

func NewCmdEditEnv added in v1.0.2

func NewCmdEditEnv(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command

NewCmdEditEnv creates a command object for the "create" command

func NewCmdEnvironment added in v1.0.2

func NewCmdEnvironment(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command

func NewCmdGet

func NewCmdGet(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command

NewCmdGet creates a command object for the generic "get" action, which retrieves one or more resources from a server.

func NewCmdGetEnv added in v1.0.2

func NewCmdGetEnv(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command

NewCmdGetEnv creates the new command for: jx get env

func NewCmdGetPipeline added in v1.0.2

func NewCmdGetPipeline(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command

NewCmdGetPipeline creates the command

func NewCmdGetURL added in v1.0.2

func NewCmdGetURL(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command

NewCmdGetURL creates the command

func NewCmdGetVersion added in v1.0.2

func NewCmdGetVersion(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command

NewCmdGetVersion creates the new command for: jx get version

func NewCmdImport

func NewCmdImport(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command

func NewCmdInit added in v1.0.2

func NewCmdInit(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command

NewCmdInit creates a command object for the generic "init" action, which primes a kubernetes cluster so it's ready for jenkins x to be installed

func NewCmdInstall

func NewCmdInstall(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command

NewCmdGet creates a command object for the generic "install" action, which installs the jenkins-x platform on a kubernetes cluster.

func NewCmdLogs added in v1.0.2

func NewCmdLogs(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command

func NewCmdNamespace

func NewCmdNamespace(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command

func NewCmdOpen

func NewCmdOpen(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command

func NewCmdPromote added in v1.0.2

func NewCmdPromote(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command

NewCmdPromote creates the new command for: jx get prompt

func NewCmdPrompt added in v1.0.2

func NewCmdPrompt(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command

NewCmdPrompt creates the new command for: jx get prompt

func NewCmdUninstall added in v1.0.2

func NewCmdUninstall(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Command

func NewCmdVersion

func NewCmdVersion(f cmdutil.Factory, out io.Writer) *cobra.Command

func NewJXCommand

func NewJXCommand(f cmdutil.Factory, in io.Reader, out, err io.Writer) *cobra.Command

NewJXCommand creates the `jx` command and its nested children.

func RunVersion

func RunVersion(f cmdutil.Factory, out io.Writer, cmd *cobra.Command) error

Types

type CommonOptions

type CommonOptions struct {
	Factory   cmdutil.Factory
	Out       io.Writer
	Err       io.Writer
	Cmd       *cobra.Command
	Args      []string
	BatchMode bool
	// contains filtered or unexported fields
}

CommonOptions contains common options and helper methods

func (*CommonOptions) CreateTable

func (c *CommonOptions) CreateTable() table.Table

func (*CommonOptions) JXClient added in v1.0.2

func (o *CommonOptions) JXClient() (*versioned.Clientset, string, error)

func (*CommonOptions) KubeClient added in v1.0.2

func (o *CommonOptions) KubeClient() (*kubernetes.Clientset, string, error)

func (*CommonOptions) Printf added in v1.0.2

func (c *CommonOptions) Printf(format string, a ...interface{}) (n int, err error)

func (*CommonOptions) Run added in v1.0.2

func (o *CommonOptions) Run() error

func (*CommonOptions) TeamAndEnvironmentNames added in v1.0.2

func (o *CommonOptions) TeamAndEnvironmentNames() (string, string, error)

type ConsoleOptions

type ConsoleOptions struct {
	CommonOptions

	OnlyViewURL bool
}

func (*ConsoleOptions) Open

func (o *ConsoleOptions) Open(name string, label string) error

func (*ConsoleOptions) Run

func (o *ConsoleOptions) Run() error

type CreateArchetypeOptions added in v1.0.2

type CreateArchetypeOptions struct {
	CreateOptions

	ArchetypeCatalogURL string

	Filter      maven.ArchetypeFilter
	PickVersion bool
	Interactive bool

	Form maven.ArchetypeForm
}

CreateArchetypeOptions the options for the create spring command

func (*CreateArchetypeOptions) Run added in v1.0.2

func (o *CreateArchetypeOptions) Run() error

Run implements the generic Create command

type CreateClusterAKSFlags added in v1.0.2

type CreateClusterAKSFlags struct {
}

type CreateClusterAKSOptions added in v1.0.2

type CreateClusterAKSOptions struct {
	CreateClusterOptions

	Flags CreateClusterAKSFlags
}

CreateClusterOptions the flags for running crest cluster

func (*CreateClusterAKSOptions) Run added in v1.0.2

func (o *CreateClusterAKSOptions) Run() error

type CreateClusterFlags added in v1.0.2

type CreateClusterFlags struct {
}

type CreateClusterGKEFlags added in v1.0.2

type CreateClusterGKEFlags struct {
}

type CreateClusterGKEOptions added in v1.0.2

type CreateClusterGKEOptions struct {
	CreateClusterOptions

	Flags CreateClusterGKEFlags
}

CreateClusterOptions the flags for running crest cluster

func (*CreateClusterGKEOptions) Run added in v1.0.2

func (o *CreateClusterGKEOptions) Run() error

type CreateClusterMinikubeFlags added in v1.0.2

type CreateClusterMinikubeFlags struct {
	Memory string
	CPU    string
	Driver string
}

type CreateClusterMinikubeOptions added in v1.0.2

type CreateClusterMinikubeOptions struct {
	CreateClusterOptions

	Flags    CreateClusterMinikubeFlags
	Provider KubernetesProvider
}

CreateClusterOptions the flags for running crest cluster

func (*CreateClusterMinikubeOptions) Run added in v1.0.2

type CreateClusterOptions added in v1.0.2

type CreateClusterOptions struct {
	CreateOptions
	Flags    InitFlags
	Provider string
}

CreateClusterOptions the flags for running crest cluster

func (*CreateClusterOptions) Run added in v1.0.2

func (o *CreateClusterOptions) Run() error

type CreateEnvOptions added in v1.0.2

type CreateEnvOptions struct {
	CreateOptions

	Options                v1.Environment
	PromotionStrategy      string
	NoGitOps               bool
	ForkEnvironmentGitRepo string
	EnvJobCredentials      string
}

CreateEnvOptions the options for the create spring command

func (*CreateEnvOptions) Run added in v1.0.2

func (o *CreateEnvOptions) Run() error

Run implements the command

type CreateOptions added in v1.0.2

type CreateOptions struct {
	CommonOptions

	DisableImport bool
	OutDir        string
}

GetOptions is the start of the data required to perform the operation. As new fields are added, add them here instead of referencing the cmd.Flags()

func (*CreateOptions) DoImport added in v1.0.2

func (o *CreateOptions) DoImport(outDir string) error

DoImport imports the project created at the given directory

func (*CreateOptions) Run added in v1.0.2

func (o *CreateOptions) Run() error

Run implements this command

type CreateSpringOptions added in v1.0.2

type CreateSpringOptions struct {
	CreateOptions

	Advanced   bool
	SpringForm spring.SpringBootForm
}

CreateSpringOptions the options for the create spring command

func (*CreateSpringOptions) Run added in v1.0.2

func (o *CreateSpringOptions) Run() error

Run implements the command

type EditEnvOptions added in v1.0.2

type EditEnvOptions struct {
	CreateOptions

	Options                v1.Environment
	PromotionStrategy      string
	NoGitOps               bool
	ForkEnvironmentGitRepo string
	EnvJobCredentials      string
}

EditEnvOptions the options for the create spring command

func (*EditEnvOptions) Run added in v1.0.2

func (o *EditEnvOptions) Run() error

Run implements the command

type EditOptions added in v1.0.2

type EditOptions struct {
	CommonOptions
}

EditOptions contains the CLI options

func (*EditOptions) Run added in v1.0.2

func (o *EditOptions) Run() error

Run implements this command

type EnvApps added in v1.0.2

type EnvApps struct {
	Environment v1.Environment
	Apps        map[string]v1beta2.Deployment
}

type EnvironmentOptions added in v1.0.2

type EnvironmentOptions struct {
	CommonOptions

	Choose bool
}

func (*EnvironmentOptions) PickNamespace added in v1.0.2

func (o *EnvironmentOptions) PickNamespace(client *kubernetes.Clientset, defaultNamespace string) (string, error)

func (*EnvironmentOptions) Run added in v1.0.2

func (o *EnvironmentOptions) Run() error

type GetEnvOptions added in v1.0.2

type GetEnvOptions struct {
	CommonOptions
}

GetEnvOptions containers the CLI options

func (*GetEnvOptions) Run added in v1.0.2

func (o *GetEnvOptions) Run() error

Run implements this command

type GetOptions

type GetOptions struct {
	CommonOptions
}

GetOptions is the start of the data required to perform the operation. As new fields are added, add them here instead of referencing the cmd.Flags()

func (*GetOptions) Run added in v1.0.2

func (o *GetOptions) Run() error

Run implements this command

type GetPipelineOptions added in v1.0.2

type GetPipelineOptions struct {
	GetOptions
}

GetPipelineOptions is the start of the data required to perform the operation. As new fields are added, add them here instead of referencing the cmd.Flags()

func (*GetPipelineOptions) Run added in v1.0.2

func (o *GetPipelineOptions) Run() error

Run implements this command

type GetURLOptions added in v1.0.2

type GetURLOptions struct {
	GetOptions
}

GetURLOptions the command line options

func (*GetURLOptions) Run added in v1.0.2

func (o *GetURLOptions) Run() error

Run implements this command

type GetVersionOptions added in v1.0.2

type GetVersionOptions struct {
	CommonOptions
}

GetVersionOptions containers the CLI options

func (*GetVersionOptions) Run added in v1.0.2

func (o *GetVersionOptions) Run() error

Run implements this command

type ImportOptions

type ImportOptions struct {
	CommonOptions

	RepoURL string

	Dir          string
	Organisation string
	Repository   string
	Credentials  string
	AppName      string

	Jenkins    *gojenkins.Jenkins
	GitConfDir string
	DryRun     bool
}

func (*ImportOptions) CloneRepository added in v1.0.2

func (o *ImportOptions) CloneRepository() error

func (*ImportOptions) CreateNewRemoteRepository added in v1.0.2

func (o *ImportOptions) CreateNewRemoteRepository() error

func (*ImportOptions) DefaultGitIgnore added in v1.0.2

func (o *ImportOptions) DefaultGitIgnore() error

DiscoverGit checks if there is a git clone or prompts the user to import it

func (*ImportOptions) DefaultJenkinsfile added in v1.0.2

func (o *ImportOptions) DefaultJenkinsfile() error

func (*ImportOptions) DiscoverGit added in v1.0.2

func (o *ImportOptions) DiscoverGit() error

DiscoverGit checks if there is a git clone or prompts the user to import it

func (*ImportOptions) DiscoverRemoteGitURL added in v1.0.2

func (o *ImportOptions) DiscoverRemoteGitURL() error

DiscoverRemoteGitURL finds the git url by looking in the directory and looking for a .git/config file

func (*ImportOptions) DoImport added in v1.0.2

func (o *ImportOptions) DoImport() error

func (*ImportOptions) DraftCreate added in v1.0.2

func (o *ImportOptions) DraftCreate() error

func (*ImportOptions) Run

func (o *ImportOptions) Run() error

type InitFlags added in v1.0.2

type InitFlags struct {
}

type InitOptions added in v1.0.2

type InitOptions struct {
	CommonOptions
	Client   clientset.Clientset
	Flags    InitFlags
	Provider KubernetesProvider
}

InitOptions the flags for running init

func (*InitOptions) Run added in v1.0.2

func (o *InitOptions) Run() error

type InstallOptions

type InstallOptions struct {
	CommonOptions

	Domain             string
	GitProvider        string
	GitToken           string
	GitUser            string
	GitPass            string
	KubernetesProvider string
	CloudEnvRepository string
	LocalHelmRepoName  string
}

GetOptions is the start of the data required to perform the operation. As new fields are added, add them here instead of referencing the cmd.Flags()

func (*InstallOptions) Run added in v1.0.2

func (options *InstallOptions) Run() error

Run implements this command

type KubernetesProvider added in v1.0.2

type KubernetesProvider string

type LogsOptions added in v1.0.2

type LogsOptions struct {
	CommonOptions

	Container string
	Namespace string
}

func (*LogsOptions) Run added in v1.0.2

func (o *LogsOptions) Run() error

type NamespaceOptions

type NamespaceOptions struct {
	CommonOptions

	Choose bool
}

func (*NamespaceOptions) PickNamespace

func (o *NamespaceOptions) PickNamespace(names []string, defaultNamespace string) (string, error)

func (*NamespaceOptions) Run

func (o *NamespaceOptions) Run() error

type OpenOptions

type OpenOptions struct {
	ConsoleOptions
}

func (*OpenOptions) Run

func (o *OpenOptions) Run() error

type PromoteOptions added in v1.0.2

type PromoteOptions struct {
	CommonOptions

	Namespace         string
	Environment       string
	Application       string
	Version           string
	LocalHelmRepoName string
	HelmRepositoryURL string
	Preview           bool
	NoHelmUpdate      bool
}

PromoteOptions containers the CLI options

func (*PromoteOptions) GetTargetNamespace added in v1.0.2

func (o *PromoteOptions) GetTargetNamespace(ns string, env string) (string, *v1.Environment, error)

func (*PromoteOptions) PromoteViaPullRequest added in v1.0.2

func (o *PromoteOptions) PromoteViaPullRequest(env *v1.Environment) error

func (*PromoteOptions) Run added in v1.0.2

func (o *PromoteOptions) Run() error

Run implements this command

type PromptOptions added in v1.0.2

type PromptOptions struct {
	CommonOptions

	NoLabel  bool
	ShowIcon bool

	Prefix    string
	Label     string
	Separator string
	Divider   string
	Suffix    string

	LabelColor []string
	TeamColor  []string
	EnvColor   []string
}

PromptOptions containers the CLI options

func (*PromptOptions) Run added in v1.0.2

func (o *PromptOptions) Run() error

Run implements this command

type Secrets

type Secrets struct {
	Login string
	Token string
}

type UninstallOptions added in v1.0.2

type UninstallOptions struct {
	CommonOptions
}

func (*UninstallOptions) Run added in v1.0.2

func (o *UninstallOptions) Run() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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