Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jenkinsci
sub-group
Jenkins Cli
提交
9fd21319
J
Jenkins Cli
项目概览
jenkinsci
/
sub-group
/
Jenkins Cli
通知
0
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
Jenkins Cli
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
9fd21319
编写于
8月 16, 2019
作者:
LinuxSuRen
提交者:
GitHub
8月 16, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #107 from yJunS/fix-sonar-check
fix sonar check unused parameters
上级
386c25bd
edf716e3
变更
26
隐藏空白更改
内联
并排
Showing
26 changed file
with
28 addition
and
29 deletion
+28
-29
app/cmd/center.go
app/cmd/center.go
+1
-1
app/cmd/config.go
app/cmd/config.go
+1
-1
app/cmd/config_add.go
app/cmd/config_add.go
+1
-1
app/cmd/config_edit.go
app/cmd/config_edit.go
+1
-1
app/cmd/config_generate.go
app/cmd/config_generate.go
+1
-1
app/cmd/config_list.go
app/cmd/config_list.go
+1
-1
app/cmd/config_remove.go
app/cmd/config_remove.go
+1
-1
app/cmd/config_select.go
app/cmd/config_select.go
+1
-1
app/cmd/crumbIssuer.go
app/cmd/crumbIssuer.go
+1
-1
app/cmd/job.go
app/cmd/job.go
+1
-1
app/cmd/job_type.go
app/cmd/job_type.go
+1
-1
app/cmd/open.go
app/cmd/open.go
+1
-1
app/cmd/plugin.go
app/cmd/plugin.go
+1
-1
app/cmd/plugin_check.go
app/cmd/plugin_check.go
+1
-1
app/cmd/plugin_install.go
app/cmd/plugin_install.go
+1
-1
app/cmd/plugin_list.go
app/cmd/plugin_list.go
+1
-1
app/cmd/plugin_open.go
app/cmd/plugin_open.go
+1
-1
app/cmd/plugin_upload.go
app/cmd/plugin_upload.go
+3
-3
app/cmd/queue.go
app/cmd/queue.go
+1
-1
app/cmd/restart.go
app/cmd/restart.go
+1
-1
app/cmd/root.go
app/cmd/root.go
+1
-1
app/cmd/user.go
app/cmd/user.go
+1
-1
app/cmd/user_edit.go
app/cmd/user_edit.go
+1
-1
app/cmd/user_token.go
app/cmd/user_token.go
+1
-1
client/user.go
client/user.go
+1
-2
util/http.go
util/http.go
+1
-1
未找到文件。
app/cmd/center.go
浏览文件 @
9fd21319
...
...
@@ -27,7 +27,7 @@ var centerCmd = &cobra.Command{
Use
:
"center"
,
Short
:
"Manage your update center"
,
Long
:
`Manage your update center`
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
_
*
cobra
.
Command
,
_
[]
string
)
{
jenkins
:=
getCurrentJenkins
()
printJenkinsStatus
(
jenkins
)
...
...
app/cmd/config.go
浏览文件 @
9fd21319
...
...
@@ -26,7 +26,7 @@ var configCmd = &cobra.Command{
Aliases
:
[]
string
{
"cfg"
},
Short
:
"Manage the config of jcli"
,
Long
:
`Manage the config of jcli`
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
_
*
cobra
.
Command
,
_
[]
string
)
{
current
:=
getCurrentJenkins
()
if
current
.
Description
!=
""
{
fmt
.
Printf
(
"Current Jenkins's name is %s, url is %s, description is %s
\n
"
,
current
.
Name
,
current
.
URL
,
current
.
Description
)
...
...
app/cmd/config_add.go
浏览文件 @
9fd21319
...
...
@@ -28,7 +28,7 @@ var configAddCmd = &cobra.Command{
Use
:
"add"
,
Short
:
"Add a Jenkins config item"
,
Long
:
`Add a Jenkins config item`
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
_
*
cobra
.
Command
,
_
[]
string
)
{
if
err
:=
addJenkins
(
configAddOptions
.
JenkinsServer
);
err
!=
nil
{
log
.
Fatal
(
err
)
}
...
...
app/cmd/config_edit.go
浏览文件 @
9fd21319
...
...
@@ -18,7 +18,7 @@ var configEditCmd = &cobra.Command{
Use
:
"edit"
,
Short
:
"Edit a Jenkins config"
,
Long
:
`Edit a Jenkins config`
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
_
*
cobra
.
Command
,
_
[]
string
)
{
current
:=
getCurrentJenkins
()
configPath
:=
configOptions
.
ConfigFileLocation
...
...
app/cmd/config_generate.go
浏览文件 @
9fd21319
...
...
@@ -28,7 +28,7 @@ var configGenerateCmd = &cobra.Command{
Aliases
:
[]
string
{
"gen"
},
Short
:
"Generate a sample config file for you"
,
Long
:
`Generate a sample config file for you`
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
_
*
cobra
.
Command
,
_
[]
string
)
{
if
data
,
err
:=
generateSampleConfig
();
err
==
nil
{
configPath
:=
configOptions
.
ConfigFileLocation
...
...
app/cmd/config_list.go
浏览文件 @
9fd21319
...
...
@@ -16,7 +16,7 @@ var configListCmd = &cobra.Command{
Use
:
"list"
,
Short
:
"List all Jenkins config items"
,
Long
:
`List all Jenkins config items`
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
_
*
cobra
.
Command
,
_
[]
string
)
{
current
:=
getCurrentJenkins
()
table
:=
util
.
CreateTable
(
os
.
Stdout
)
...
...
app/cmd/config_remove.go
浏览文件 @
9fd21319
...
...
@@ -15,7 +15,7 @@ var configRemoveCmd = &cobra.Command{
Use
:
"remove"
,
Short
:
"Remove a Jenkins config"
,
Long
:
`Remove a Jenkins config`
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
_
*
cobra
.
Command
,
args
[]
string
)
{
if
len
(
args
)
==
0
{
log
.
Fatal
(
"You need to give a name"
)
}
...
...
app/cmd/config_select.go
浏览文件 @
9fd21319
...
...
@@ -13,7 +13,7 @@ var configSelectCmd = &cobra.Command{
Use
:
"select [<name>]"
,
Short
:
"Select one config as current Jenkins"
,
Long
:
`Select one config as current Jenkins`
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
_
*
cobra
.
Command
,
args
[]
string
)
{
if
len
(
args
)
>
0
{
jenkinsName
:=
args
[
0
]
...
...
app/cmd/crumbIssuer.go
浏览文件 @
9fd21319
...
...
@@ -28,7 +28,7 @@ var versionCmd = &cobra.Command{
Use
:
"crumb"
,
Short
:
"Print crumbIssuer of Jenkins"
,
Long
:
`Print crumbIssuer of Jenkins`
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
_
*
cobra
.
Command
,
_
[]
string
)
{
crumb
,
_
:=
getCrumb
()
fmt
.
Printf
(
"%s=%s"
,
crumb
.
CrumbRequestField
,
crumb
.
Crumb
)
},
...
...
app/cmd/job.go
浏览文件 @
9fd21319
...
...
@@ -19,7 +19,7 @@ var jobCmd = &cobra.Command{
Use
:
"job"
,
Short
:
"Print the job of your Jenkins"
,
Long
:
`Print the job of your Jenkins`
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
cmd
*
cobra
.
Command
,
_
[]
string
)
{
cmd
.
Help
()
},
}
app/cmd/job_type.go
浏览文件 @
9fd21319
...
...
@@ -25,7 +25,7 @@ var jobTypeCmd = &cobra.Command{
Use
:
"type"
,
Short
:
"Print the types of job which in your Jenkins"
,
Long
:
`Print the types of job which in your Jenkins`
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
_
*
cobra
.
Command
,
_
[]
string
)
{
jenkins
:=
getCurrentJenkins
()
jclient
:=
&
client
.
JobClient
{}
jclient
.
URL
=
jenkins
.
URL
...
...
app/cmd/open.go
浏览文件 @
9fd21319
...
...
@@ -30,7 +30,7 @@ var openCmd = &cobra.Command{
Use
:
"open"
,
Short
:
"Open your Jenkins with a browse"
,
Long
:
`Open your Jenkins with a browse`
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
_
*
cobra
.
Command
,
_
[]
string
)
{
var
jenkins
*
JenkinsServer
if
openOption
.
Name
==
""
&&
openOption
.
Interactive
{
...
...
app/cmd/plugin.go
浏览文件 @
9fd21319
...
...
@@ -21,7 +21,7 @@ var pluginCmd = &cobra.Command{
Example
:
` jcli plugin list
jcli plugin search github
jcli plugin check`
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
cmd
*
cobra
.
Command
,
_
[]
string
)
{
cmd
.
Help
()
},
}
app/cmd/plugin_check.go
浏览文件 @
9fd21319
...
...
@@ -18,7 +18,7 @@ var pluginCheckCmd = &cobra.Command{
Use
:
"check"
,
Short
:
"Checkout update center server"
,
Long
:
`Checkout update center server`
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
_
*
cobra
.
Command
,
_
[]
string
)
{
jenkins
:=
getCurrentJenkins
()
jclient
:=
&
client
.
PluginManager
{}
jclient
.
URL
=
jenkins
.
URL
...
...
app/cmd/plugin_install.go
浏览文件 @
9fd21319
...
...
@@ -17,7 +17,7 @@ var pluginInstallCmd = &cobra.Command{
Use
:
"install [pluginName]"
,
Short
:
"Install the plugins"
,
Long
:
`Install the plugins`
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
_
*
cobra
.
Command
,
args
[]
string
)
{
jenkins
:=
getCurrentJenkins
()
jclient
:=
&
client
.
PluginManager
{}
jclient
.
URL
=
jenkins
.
URL
...
...
app/cmd/plugin_list.go
浏览文件 @
9fd21319
...
...
@@ -30,7 +30,7 @@ var pluginListCmd = &cobra.Command{
Long
:
`Print all the plugins which are installed`
,
Example
:
` jcli plugin list --filter name=github
jcli plugin list --filter hasUpdate`
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
_
*
cobra
.
Command
,
_
[]
string
)
{
jenkins
:=
getCurrentJenkins
()
jclient
:=
&
client
.
PluginManager
{}
jclient
.
URL
=
jenkins
.
URL
...
...
app/cmd/plugin_open.go
浏览文件 @
9fd21319
...
...
@@ -15,7 +15,7 @@ var pluginOpenCmd = &cobra.Command{
Use
:
"open"
,
Short
:
"Openout update center server"
,
Long
:
`Openout update center server`
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
_
*
cobra
.
Command
,
_
[]
string
)
{
jenkins
:=
getCurrentJenkins
()
if
jenkins
.
URL
!=
""
{
...
...
app/cmd/plugin_upload.go
浏览文件 @
9fd21319
...
...
@@ -8,8 +8,8 @@ import (
"path/filepath"
"strings"
"github.com/jenkins-zh/jenkins-cli/client"
"github.com/jenkins-zh/jenkins-cli/util"
"github.com/jenkins-zh/jenkins-cli/client"
"github.com/spf13/cobra"
)
...
...
@@ -40,7 +40,7 @@ var pluginUploadCmd = &cobra.Command{
Long
:
`Upload a plugin from local filesystem or remote URL to your Jenkins`
,
Example
:
` jcli plugin upload --remote https://server/sample.hpi
jcli plugin upload sample.hpi`
,
PreRun
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
PreRun
:
func
(
_
*
cobra
.
Command
,
args
[]
string
)
{
if
pluginUploadOption
.
Remote
!=
""
{
file
,
err
:=
ioutil
.
TempFile
(
"."
,
"jcli-plugin"
)
if
err
!=
nil
{
...
...
@@ -80,7 +80,7 @@ var pluginUploadCmd = &cobra.Command{
pluginUploadOption
.
pluginFilePath
=
args
[
0
]
}
},
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
_
*
cobra
.
Command
,
_
[]
string
)
{
jenkins
:=
getCurrentJenkins
()
jclient
:=
&
client
.
PluginManager
{}
jclient
.
URL
=
jenkins
.
URL
...
...
app/cmd/queue.go
浏览文件 @
9fd21319
...
...
@@ -23,7 +23,7 @@ var queueCmd = &cobra.Command{
Use
:
"queue"
,
Short
:
"Print the queue of your Jenkins"
,
Long
:
`Print the queue of your Jenkins`
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
_
*
cobra
.
Command
,
_
[]
string
)
{
jenkins
:=
getCurrentJenkins
()
jclient
:=
&
client
.
QueueClient
{}
jclient
.
URL
=
jenkins
.
URL
...
...
app/cmd/restart.go
浏览文件 @
9fd21319
...
...
@@ -24,7 +24,7 @@ var restartCmd = &cobra.Command{
Use
:
"restart"
,
Short
:
"Restart your Jenkins"
,
Long
:
`Restart your Jenkins`
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
_
*
cobra
.
Command
,
_
[]
string
)
{
jenkins
:=
getCurrentJenkins
()
if
!
restartOption
.
Batch
{
confirm
:=
false
...
...
app/cmd/root.go
浏览文件 @
9fd21319
...
...
@@ -20,7 +20,7 @@ var rootCmd = &cobra.Command{
Long
:
`jcli is Jenkins CLI which could help with your multiple Jenkins,
Manage your Jenkins and your pipelines
More information could found at https://jenkins-zh.cn`
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
_
*
cobra
.
Command
,
_
[]
string
)
{
fmt
.
Println
(
"Jenkins CLI (jcli) manage your Jenkins"
)
current
:=
getCurrentJenkins
()
...
...
app/cmd/user.go
浏览文件 @
9fd21319
...
...
@@ -23,7 +23,7 @@ var userCmd = &cobra.Command{
Use
:
"user"
,
Short
:
"Print the user of your Jenkins"
,
Long
:
`Print the user of your Jenkins`
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
_
*
cobra
.
Command
,
_
[]
string
)
{
jenkins
:=
getCurrentJenkins
()
jclient
:=
&
client
.
UserClient
{}
jclient
.
URL
=
jenkins
.
URL
...
...
app/cmd/user_edit.go
浏览文件 @
9fd21319
...
...
@@ -23,7 +23,7 @@ var userEditCmd = &cobra.Command{
Use
:
"edit"
,
Short
:
"Edit the user of your Jenkins"
,
Long
:
`Edit the user of your Jenkins`
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
_
*
cobra
.
Command
,
_
[]
string
)
{
jenkins
:=
getCurrentJenkins
()
jclient
:=
&
client
.
UserClient
{}
jclient
.
URL
=
jenkins
.
URL
...
...
app/cmd/user_token.go
浏览文件 @
9fd21319
...
...
@@ -25,7 +25,7 @@ var userTokenCmd = &cobra.Command{
Use
:
"token"
,
Short
:
"Token the user of your Jenkins"
,
Long
:
`Token the user of your Jenkins`
,
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
cmd
*
cobra
.
Command
,
_
[]
string
)
{
if
!
userTokenOption
.
Generate
{
cmd
.
Help
()
return
...
...
client/user.go
浏览文件 @
9fd21319
...
...
@@ -89,8 +89,7 @@ func (q *UserClient) EditDesc(description string) (err error) {
code
:=
response
.
StatusCode
var
data
[]
byte
data
,
err
=
ioutil
.
ReadAll
(
response
.
Body
)
if
code
==
200
{
}
else
{
if
code
!=
200
{
log
.
Fatal
(
string
(
data
))
}
}
else
{
...
...
util/http.go
浏览文件 @
9fd21319
...
...
@@ -107,7 +107,7 @@ func (i *ProgressIndicator) Init() {
// i.bar.PrependElapsed()
if
i
.
Title
!=
""
{
i
.
bar
.
PrependFunc
(
func
(
b
*
uiprogress
.
Bar
)
string
{
i
.
bar
.
PrependFunc
(
func
(
_
*
uiprogress
.
Bar
)
string
{
return
fmt
.
Sprintf
(
"%s: "
,
i
.
Title
)
})
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录