jenkins-cli: github.com/jenkins-zh/jenkins-cli/app/cmd Index | Files | Directories

package cmd

import "github.com/jenkins-zh/jenkins-cli/app/cmd"

Index

Package Files

casc.go casc_apply.go casc_export.go casc_open.go casc_reload.go casc_schema.go center.go center_download.go center_identity.go center_mirror.go center_start.go center_upgrade.go center_watch.go completion.go computer.go computer_create.go computer_delete.go computer_launch.go computer_list.go computer_log.go config.go config_add.go config_clean.go config_edit.go config_generate.go config_list.go config_plugin.go config_remove.go config_select.go credential.go credential_create.go credential_delete.go credential_list.go crumbIssuer.go cwp.go doc.go job.go job_artifact.go job_artifact_download.go job_build.go job_create.go job_delete.go job_disable.go job_edit.go job_enable.go job_history.go job_input.go job_log.go job_param.go job_search.go job_stop.go job_type.go open.go plugin.go plugin_build.go plugin_check.go plugin_create.go plugin_download.go plugin_install.go plugin_list.go plugin_open.go plugin_release.go plugin_search.go plugin_trend.go plugin_uninstall.go plugin_upgrade.go plugin_upload.go queue.go queue_cancel.go queue_list.go restart.go root.go runner.go shell.go shutdown.go user.go user_create.go user_delete.go user_edit.go user_token.go

Constants

const (
    // DocTypeMarkdown represents markdown type of doc
    DocTypeMarkdown string = "Markdown"
    // DocTypeManPage represents man page type of doc
    DocTypeManPage string = "ManPage"
)
const (
    UTF8    = "UTF-8"
    GB18030 = "GB18030"
)
const (
    // AgentJNLP is the agent type of jnlp
    AgentJNLP = "jnlp"
)
const (
    // SafeShutdown the text about shutdown safely
    SafeShutdown = "Puts Jenkins into the quiet mode, wait for existing builds to be completed, and then shut down Jenkins"
)

Variables

var ShellTypes = []string{
    "zsh", "bash", "powerShell",
}

ShellTypes contains all types of shell

func ConvertByte2String Uses

func ConvertByte2String(byte []byte, charset string) string

ConvertByte2String convert byte to string

func Execute Uses

func Execute()

Execute will execute the command

func GenerateSampleConfig Uses

func GenerateSampleConfig() ([]byte, error)

GenerateSampleConfig returns a sample config

func GetCategories Uses

func GetCategories(jclient *client.JobClient) (
    typeMap map[string]string, types []string, err error)

GetCategories returns the categories of current Jenkins

func GetComputerClient Uses

func GetComputerClient(option common.CommonOption) (*client.ComputerClient, *JenkinsServer)

GetComputerClient returns the client of computer

func GetConfigFromHome Uses

func GetConfigFromHome() (configPath string, homeErr error)

GetConfigFromHome returns the config file path from user home dir

func GetRootCommand Uses

func GetRootCommand() *cobra.Command

GetRootCommand returns the root cmd

func NewConfigPluginFetchCmd Uses

func NewConfigPluginFetchCmd() (cmd *cobra.Command)

NewConfigPluginFetchCmd create a command for fetching plugin metadata

func NewConfigPluginInstallCmd Uses

func NewConfigPluginInstallCmd() (cmd *cobra.Command)

NewConfigPluginInstallCmd create a command for fetching plugin metadata

func NewConfigPluginListCmd Uses

func NewConfigPluginListCmd() (cmd *cobra.Command)

NewConfigPluginListCmd create a command for list all jcli plugins

func NewShutdownCmd Uses

func NewShutdownCmd(rootOpt *RootOptions) (cmd *cobra.Command)

NewShutdownCmd create the shutdown command

func RenderTemplate Uses

func RenderTemplate(filepath string, values map[string]string) (result string, err error)

RenderTemplate render a go template to a temporary file

func ResetJobBuildOption Uses

func ResetJobBuildOption()

ResetJobBuildOption give it a clean option struct

type CASCApplyOption Uses

type CASCApplyOption struct {
    RoundTripper http.RoundTripper
}

CASCApplyOption as the options of apply configuration as code

type CASCExportOption Uses

type CASCExportOption struct {
    RoundTripper http.RoundTripper
}

CASCExportOption as the options of reload configuration as code

type CASCOpenOption Uses

type CASCOpenOption struct {
    ExecContext util.ExecContext

    Browser string
}

CASCOpenOption is the option of casc open cmd

type CASCOptions Uses

type CASCOptions struct {
    common.CommonOption
}

CASCOptions is the option of casc

func (*CASCOptions) Check Uses

func (o *CASCOptions) Check() (err error)

Check do the health check of casc cmd

type CASCReloadOption Uses

type CASCReloadOption struct {
    RoundTripper http.RoundTripper
}

CASCReloadOption as the options of reload configuration as code

type CASCSchemaOption Uses

type CASCSchemaOption struct {
    RoundTripper http.RoundTripper
}

CASCSchemaOption as the options of reload configuration as code

type CWPOptions Uses

type CWPOptions struct {
    common.CommonOption

    ConfigPath      string
    Version         string
    TmpDir          string
    Environment     string
    BomPath         string
    MvnSettingsFile string

    BatchMode        bool
    Demo             bool
    InstallArtifacts bool

    ShowProgress bool
    MetadataURL  string
    LocalCache   string

    ValueSet map[string]string
}

CWPOptions is the option of custom-war-packager see also https://github.com/jenkinsci/custom-war-packager

func (*CWPOptions) Download Uses

func (o *CWPOptions) Download() (err error)

Download get the latest cwp from server into local

func (*CWPOptions) GetCWPURL Uses

func (o *CWPOptions) GetCWPURL(version string) string

GetCWPURL returns the download URL of a specific version cwp

func (*CWPOptions) GetLatest Uses

func (o *CWPOptions) GetLatest() (version string, err error)

GetLatest returns the latest of cwp

func (*CWPOptions) Run Uses

func (o *CWPOptions) Run(cmd *cobra.Command, args []string) (err error)

Run is the main logic of cwp cmd

type CenterDownloadOption Uses

type CenterDownloadOption struct {
    LTS     bool
    Mirror  string
    Version string

    Output       string
    ShowProgress bool

    Formula string

    RoundTripper http.RoundTripper
}

CenterDownloadOption as the options of download command

func (*CenterDownloadOption) DownloadJenkins Uses

func (c *CenterDownloadOption) DownloadJenkins() (err error)

DownloadJenkins download the Jenkins

type CenterIdentityOption Uses

type CenterIdentityOption struct {
    common.CommonOption
}

CenterIdentityOption option for upgrade Jenkins

type CenterMirrorOption Uses

type CenterMirrorOption struct {
    RoundTripper http.RoundTripper

    Enable    bool
    MirrorURL string
}

CenterMirrorOption option for upgrade Jenkins

type CenterOption Uses

type CenterOption struct {
    common.WatchOption

    RoundTripper http.RoundTripper
    CenterStatus string
}

CenterOption is the center cmd option

type CenterStartOption Uses

type CenterStartOption struct {
    common.CommonOption

    Port                      int
    Context                   string
    SetupWizard               bool
    AdminCanGenerateNewTokens bool

    // comes from folder plugin
    ConcurrentIndexing int

    Admin string

    HTTPSEnable      bool
    HTTPSPort        int
    HTTPSCertificate string
    HTTPSPrivateKey  string

    Environments []string
    System       []string

    Download     bool
    Version      string
    LTS          bool
    Formula      string
    RandomWebDir bool

    DryRun bool
}

CenterStartOption option for upgrade Jenkins

type CenterUpgradeOption Uses

type CenterUpgradeOption struct {
    RoundTripper http.RoundTripper
}

CenterUpgradeOption option for upgrade Jenkins

type CenterWatchOption Uses

type CenterWatchOption struct {
    common.WatchOption
    UtilNeedRestart     bool
    UtilInstallComplete bool

    RoundTripper  http.RoundTripper
    CeneterStatus string
}

CenterWatchOption as the options of watch command

type CheckResult Uses

type CheckResult struct {
    Name       string
    StatusCode int
    Timeout    bool
}

CheckResult is the result of checking

type CompletionOptions Uses

type CompletionOptions struct {
    Type string
}

CompletionOptions is the option of completion command

type ComputerCreateOption Uses

type ComputerCreateOption struct {
    common.CommonOption
    common.OutputOption
}

ComputerCreateOption option for config list command

type ComputerDeleteOption Uses

type ComputerDeleteOption struct {
    common.CommonOption
}

ComputerDeleteOption option for agent delete command

type ComputerLaunchOption Uses

type ComputerLaunchOption struct {
    common.CommonOption

    Type         string
    ShowProgress bool

    /** share info between inner functions */
    ComputerClient *client.ComputerClient
    CurrentJenkins *JenkinsServer
    Output         string
}

ComputerLaunchOption option for config list command

func (*ComputerLaunchOption) Check Uses

func (o *ComputerLaunchOption) Check() (err error)

Check do the health check of casc cmd

func (*ComputerLaunchOption) Launch Uses

func (o *ComputerLaunchOption) Launch(name string) (err error)

Launch start a normal agent

func (*ComputerLaunchOption) LaunchJnlp Uses

func (o *ComputerLaunchOption) LaunchJnlp(name string) (err error)

LaunchJnlp start a JNLP agent

type ComputerListOption Uses

type ComputerListOption struct {
    common.CommonOption
    common.OutputOption
}

ComputerListOption option for config list command

type ComputerLogOption Uses

type ComputerLogOption struct {
    common.CommonOption
}

ComputerLogOption option for config list command

type ConfigAddOptions Uses

type ConfigAddOptions struct {
    JenkinsServer
}

ConfigAddOptions is the config ad option

type ConfigCleanOption Uses

type ConfigCleanOption struct {
    Timeout      int
    CleanTimeout bool

    Logger helper.Printer
}

ConfigCleanOption option for config list command

func (*ConfigCleanOption) Check Uses

func (o *ConfigCleanOption) Check(jenkins cfg.JenkinsServer) (result CheckResult)

Check check the target JenkinsServer config make a request to a Jenkins API

func (*ConfigCleanOption) CleanByCondition Uses

func (o *ConfigCleanOption) CleanByCondition(resultList []CheckResult) (err error)

CleanByCondition do the clean work by conditions

func (*ConfigCleanOption) Run Uses

func (o *ConfigCleanOption) Run(cmd *cobra.Command, args []string) (err error)

Run is the main entry point of command config-clean

type ConfigEditOption Uses

type ConfigEditOption struct {
    common.CommonOption
}

ConfigEditOption is the option for edit config command

type ConfigGenerateOption Uses

type ConfigGenerateOption struct {
    common.InteractiveOption
    common.CommonOption
    common.BatchOption

    Copy bool
}

ConfigGenerateOption is the config generate cmd option

func (*ConfigGenerateOption) InteractiveWithConfig Uses

func (o *ConfigGenerateOption) InteractiveWithConfig(cmd *cobra.Command, data []byte) (err error)

InteractiveWithConfig be friendly for a newer

type ConfigListOption Uses

type ConfigListOption struct {
    common.OutputOption

    Config string
}

ConfigListOption option for config list command

type ConfigOptions Uses

type ConfigOptions struct {
    common.CommonOption

    ConfigFileLocation string
    Detail             bool
    Decrypt            bool
}

ConfigOptions is the config cmd option

type ConfigSelectOptions Uses

type ConfigSelectOptions struct {
    common.CommonOption
}

ConfigSelectOptions is the option for select a config

type CredentialCreateOption Uses

type CredentialCreateOption struct {
    Description string
    ID          string
    Store       string

    Username string
    Password string

    Secret string

    Scope string
    Type  string

    RoundTripper http.RoundTripper
}

CredentialCreateOption option for credential delete command

type CredentialDeleteOption Uses

type CredentialDeleteOption struct {
    common.BatchOption

    ID    string
    Store string

    RoundTripper http.RoundTripper
}

CredentialDeleteOption option for credential delete command

type CredentialListOption Uses

type CredentialListOption struct {
    common.OutputOption

    Store string

    RoundTripper http.RoundTripper
}

CredentialListOption option for credential list command

type CrumbIssuerOptions Uses

type CrumbIssuerOptions struct {
    RoundTripper http.RoundTripper
}

CrumbIssuerOptions contains the command line options

type DocOption Uses

type DocOption struct {
    DocType string
}

DocOption is the option for doc generating

type JobArtifactDownloadOption Uses

type JobArtifactDownloadOption struct {
    ID           string
    ShowProgress bool
    DownloadDir  string

    Jenkins      *JenkinsServer
    RoundTripper http.RoundTripper
}

JobArtifactDownloadOption is the options of job artifact download command

type JobArtifactOption Uses

type JobArtifactOption struct {
    common.OutputOption
    common.CommonOption
}

JobArtifactOption is the options of job artifact command

type JobBuildOption Uses

type JobBuildOption struct {
    common.BatchOption
    common.CommonOption
    common.OutputOption

    Param      string
    ParamArray []string

    ParamFilePathArray []string

    Wait     bool
    WaitTime int
    Delay    int
    Cause    string
}

JobBuildOption is the job build option

type JobCreateOption Uses

type JobCreateOption struct {
    Copy string
    Type string

    RoundTripper http.RoundTripper
}

JobCreateOption is the job create option

type JobDeleteOption Uses

type JobDeleteOption struct {
    common.BatchOption
    common.CommonOption
}

JobDeleteOption is the job delete option

type JobDisableOption Uses

type JobDisableOption struct {
    common.BatchOption
    common.CommonOption
}

JobDisableOption is the job delete option

type JobEditOption Uses

type JobEditOption struct {
    common.CommonOption

    Filename  string
    Script    string
    URL       string
    Sample    bool
    TrimSpace bool
    // Build flag indicates if trigger the Jenkins job after the action of edit
    Build bool
}

JobEditOption is the option for job create command

type JobEnableOption Uses

type JobEnableOption struct {
    common.BatchOption
    common.CommonOption
}

JobEnableOption is the job delete option

type JobHistoryOption Uses

type JobHistoryOption struct {
    common.OutputOption

    RoundTripper http.RoundTripper
}

JobHistoryOption is the job history option

type JobInputOption Uses

type JobInputOption struct {
    common.BatchOption

    Action string

    RoundTripper http.RoundTripper
}

JobInputOption is the job delete option

type JobLogOption Uses

type JobLogOption struct {
    common.WatchOption
    History int

    LogText      string
    LastBuildID  int
    LastBuildURL string

    RoundTripper http.RoundTripper
}

JobLogOption is the job log option

type JobOption Uses

type JobOption struct {
    common.OutputOption
}

JobOption is the job cmd option

type JobParamOption Uses

type JobParamOption struct {
    common.OutputOption

    Indent bool

    RoundTripper http.RoundTripper
}

JobParamOption is the job param option

type JobSearchOption Uses

type JobSearchOption struct {
    common.CommonOption
    common.OutputOption
    Name   string
    Type   string
    Parent string

    Start int
    Limit int
}

JobSearchOption is the options of job search command

func (*JobSearchOption) Check Uses

func (o *JobSearchOption) Check() (err error)

Check do the conditions check

type JobStopOption Uses

type JobStopOption struct {
    common.BatchOption
    common.CommonOption
}

JobStopOption is the job stop option

type JobTypeOption Uses

type JobTypeOption struct {
    common.OutputOption
    common.CommonOption
}

JobTypeOption is the job type cmd option

type MavenMetadata Uses

type MavenMetadata struct {
    XMLName    xml.Name        `xml:"metadata"`
    Versioning MavenVersioning `xml:"versioning"`
}

MavenMetadata is the maven metadata xml root

type MavenVersioning Uses

type MavenVersioning struct {
    XMLName xml.Name `xml:"versioning"`
    Latest  string   `xml:"latest"`
    Release string   `xml:"release"`
}

MavenVersioning is the versioning of maven

type OpenOption Uses

type OpenOption struct {
    common.CommonOption
    common.InteractiveOption

    Browser string

    Config bool
}

OpenOption is the open cmd option

type PluginBuildOptions Uses

type PluginBuildOptions struct {
    common.CommonOption

    DebugOutput bool
}

PluginBuildOptions for the plugin build command

type PluginCheckoutOption Uses

type PluginCheckoutOption struct {
    RoundTripper http.RoundTripper
    // Timeout is the timeout setting for check Jenkins update-center
    Timeout int64
}

PluginCheckoutOption is the option for plugin checkout command

type PluginCreateOptions Uses

type PluginCreateOptions struct {
    common.CommonOption

    DebugOutput bool
}

PluginCreateOptions for the plugin create command

type PluginDownloadOption Uses

type PluginDownloadOption struct {
    SkipDependency bool
    SkipOptional   bool
    UseMirror      bool
    ShowProgress   bool
    DownloadDir    string

    RoundTripper http.RoundTripper
}

PluginDownloadOption is the option for plugin download command

type PluginInstallOption Uses

type PluginInstallOption struct {
    UseMirror    bool
    ShowProgress bool

    RoundTripper http.RoundTripper
}

PluginInstallOption is the option for plugin install

type PluginListOption Uses

type PluginListOption struct {
    common.OutputOption

    RoundTripper http.RoundTripper
}

PluginListOption option for plugin list command

type PluginOpenOption Uses

type PluginOpenOption struct {
    ExecContext util.ExecContext

    Browser string
}

PluginOpenOption is the option of plugin open cmd

type PluginOptions Uses

type PluginOptions struct {
    common.CommonOption

    Suite string
}

PluginOptions contains the command line options

func (*PluginOptions) FindPlugin Uses

func (o *PluginOptions) FindPlugin(name string) (plugin *client.InstalledPlugin, err error)

FindPlugin find a plugin by name

type PluginReleaseOptions Uses

type PluginReleaseOptions struct {
    common.CommonOption

    Batch       bool
    Prepare     bool
    Perform     bool
    SkipTests   bool
    DebugOutput bool
}

PluginReleaseOptions for the plugin create command

type PluginSearchOption Uses

type PluginSearchOption struct {
    common.OutputOption

    RoundTripper http.RoundTripper
}

PluginSearchOption is the plugin search option

func (*PluginSearchOption) Output Uses

func (o *PluginSearchOption) Output(obj interface{}) (data []byte, err error)

Output output the data into buffer

type PluginTreadOption Uses

type PluginTreadOption struct {
    RoundTripper http.RoundTripper
}

PluginTreadOption is the option of plugin trend command

type PluginUninstallOption Uses

type PluginUninstallOption struct {
    RoundTripper http.RoundTripper
}

PluginUninstallOption the option of uninstall a plugin

type PluginUpgradeOption Uses

type PluginUpgradeOption struct {
    Filter []string
    All    bool

    RoundTripper http.RoundTripper
}

PluginUpgradeOption option for plugin list command

type PluginUploadOption Uses

type PluginUploadOption struct {
    Remote         string
    RemoteUser     string
    RemotePassword string
    RemoteJenkins  string
    ShowProgress   bool
    FileName       string
    // Timeout is the timeout when upload the plugin
    Timeout int64

    RoundTripper http.RoundTripper

    common.HookOption
    // contains filtered or unexported fields
}

PluginUploadOption will hold the options of plugin cmd

func (*PluginUploadOption) HPICompletion Uses

func (o *PluginUploadOption) HPICompletion(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

type QueueCancelOption Uses

type QueueCancelOption struct {
    RoundTripper http.RoundTripper
}

QueueCancelOption represents the option of queue cancel command

type QueueListOption Uses

type QueueListOption struct {
    common.OutputOption

    RoundTripper http.RoundTripper
}

QueueListOption represents the option of queue list command

type RestartOption Uses

type RestartOption struct {
    common.BatchOption
    common.CommonOption

    Safe bool
}

RestartOption holds the options for restart cmd

type RootOptions Uses

type RootOptions struct {
    ConfigFile string
    ConfigLoad bool
    Jenkins    string
    Debug      bool

    URL                string
    Username           string
    Token              string
    InsecureSkipVerify bool
    Proxy              string
    ProxyAuth          string
    ProxyDisable       bool
    Timeout            int64

    Doctor    bool
    StartTime time.Time
    EndTime   time.Time

    CommonOption *common.CommonOption

    LoggerLevel string
}

RootOptions is a global option for whole cli

func GetRootOptions Uses

func GetRootOptions() *RootOptions

GetRootOptions returns the root options

func (*RootOptions) GetCurrentJenkinsAndClient Uses

func (o *RootOptions) GetCurrentJenkinsAndClient(jClient *client.JenkinsCore) *JenkinsServer

GetCurrentJenkinsAndClient returns the current Jenkins

func (*RootOptions) GetCurrentJenkinsFromOptions Uses

func (o *RootOptions) GetCurrentJenkinsFromOptions() *JenkinsServer

GetCurrentJenkinsFromOptions returns the current Jenkins

func (*RootOptions) GetGitHubClient Uses

func (o *RootOptions) GetGitHubClient() *github.Client

GetGitHubClient returns the GitHub client

func (*RootOptions) GetMirror Uses

func (o *RootOptions) GetMirror(name string) string

GetMirror returns the mirror

func (*RootOptions) RunDiagnose Uses

func (o *RootOptions) RunDiagnose(cmd *cobra.Command) (err error)

RunDiagnose run the diagnose for a specific command

func (*RootOptions) SetGitHubClient Uses

func (o *RootOptions) SetGitHubClient(gitHubClient *github.Client)

SetGitHubClient set the GitHub client

type RunnerOption Uses

type RunnerOption struct {
    common.BatchOption
    common.CommonOption
    RoundTripper http.RoundTripper

    Safe            bool
    WarVersion      string
    WarPath         string
    PluginPath      string
    JenkinsfilePath string
    JfrVersion      string
    LTS             bool
}

RunnerOption is the wrapper of jenkinsfile runner cli

type ShellOptions Uses

type ShellOptions struct {
    common.CommonOption

    TmpDir            string
    TmpConfigFileName string
}

ShellOptions is the option of shell command

type ShutdownOption Uses

type ShutdownOption struct {
    common.BatchOption
    common.CommonOption
    RootOptions *RootOptions

    Safe          bool
    Prepare       bool
    CancelPrepare bool
}

ShutdownOption holds the options for shutdown cmd

type UserCreateOption Uses

type UserCreateOption struct {
    RoundTripper http.RoundTripper
}

UserCreateOption is user create cmd option

type UserDeleteOption Uses

type UserDeleteOption struct {
    common.BatchOption

    RoundTripper http.RoundTripper
}

UserDeleteOption is user delete cmd option

type UserEditOption Uses

type UserEditOption struct {
    common.CommonOption

    Description string
}

UserEditOption is the user edit cmd option

type UserOption Uses

type UserOption struct {
    common.OutputOption

    RoundTripper http.RoundTripper
}

UserOption is the user cmd option

type UserTokenOption Uses

type UserTokenOption struct {
    Generate   bool
    Name       string
    TargetUser string

    RoundTripper http.RoundTripper
}

UserTokenOption represents a user token cmd option

Directories

PathSynopsis
common
config_plugin
keyring
version

Package cmd imports 53 packages (graph) and is imported by 1 packages. Updated 2020-10-07. Refresh now. Tools for package owners.