美文网首页
Jenkins CLI 使用记录

Jenkins CLI 使用记录

作者: acc8226 | 来源:发表于2021-12-06 11:02 被阅读0次

Jenkins 自带 CLI 工具

Jenkins CLI
Usage: java -jar jenkins-cli.jar [-s URL] command [opts...] args...
Options:
 -s URL              : the server URL (defaults to the JENKINS_URL env var)
 -http               : use a plain CLI protocol over HTTP(S) (the default; mutually exclusive with -ssh)
 -ssh                : use SSH protocol (requires -user; SSH port must be open on server, and user must have registered a public key)
 -i KEY              : SSH private key file used for authentication (for use with -ssh)
 -noCertificateCheck : bypass HTTPS certificate check entirely. Use with caution
 -noKeyAuth          : don't try to load the SSH authentication private key. Conflicts with -i
 -user               : specify user (for use with -ssh)
 -strictHostKey      : request strict host key checking (for use with -ssh)
 -logger FINE        : enable detailed logging from the client
 -auth [ USER:SECRET | @FILE ] : specify username and either password or API token (or load from them both from a file);
                                 for use with -http.
                                 Passing credentials by file is recommended.
                                 See https://jenkins.io/redirect/cli-http-connection-mode for more info and options.

The available commands depend on the server. Run the 'help' command to see the list.
Starts a build, and optionally waits for a completion.
Aside from general scripting use, this command can be
used to invoke another job from within a build of one job.
With the -s option, this command changes the exit code based on
the outcome of the build (exit code 0 indicates a success)
and interrupting the command will interrupt the job.
With the -f option, this command changes the exit code based on
the outcome of the build (exit code 0 indicates a success)
however, unlike -s, interrupting the command will not interrupt
the job (exit code 125 indicates the command was interrupted).
With the -c option, a build will only run if there has been
an SCM change.

 JOB : Name of the job to build
 -c  : Check for SCM changes before starting the build, and if there's no
       change, exit without doing a build
 -f  : Follow the build progress. Like -s only interrupts are not passed
       through to the build.
 -p  : Specify the build parameters in the key=value format.
 -s  : Wait until the completion/abortion of the command. Interrupts are passed
       through to the build.
 -v  : Prints out the console output of the build. Use with -s
 -w  : Wait until the start of the command

-c :在开始构建之前检查SCM更改,如果没有更改,退出而不进行构建
-f : 跟踪构建进度。 中断不被传递给命令
-p : 构建中在KEY=值格式中指定生成参数
-s : Wait until the completion/abortion of the command. 中断会被传递给命令
-v : 打印出构建的控制台输出。一般和 -s 或 -f 连用
-w : Wait until the start of the command

示例:

  • java -jar jenkins-cli.jar -s http://10.3.104.109:9070/ -auth root:123456 build project01 -f
  • java -jar jenkins-cli.jar -s http://10.3.104.109:9070/ -auth root:123456 build project02 -p branchs=origin/fix01 -f

相关文章

  • Jenkins CLI 使用记录

    Jenkins 自带 CLI 工具 -c :在开始构建之前检查SCM更改,如果没有更改,退出而不进行构建-f ...

  • Jenkins导出导入配置

    下载Jenkins-cli.jar jenkins-cli.jar 位置首页-系统管理-Jenkins CLI 点...

  • 2. Jenkins使用 -- CLI

    文章已经迁移到我的个人博客,里面还有更多内容。 2. Jenkins使用 -- CLI 使用命令行界面CLI (c...

  • Jenkins 自动打包上传 fir/fastlane等配置通用

    脚本自行解决 安装Jenkins JenKins安装 fir-cli基本使用 安装遇到其他问题请自行搜索解决. 1...

  • python使用request启动jenkins

    之前写了一篇命令行启动jenkins的三种方法分别是使用curl 、使用jenkins-cli命令行调用jar包启...

  • 2018-11-21

    vue-cli 3.0 使用小结 个人使用 VUE-CLI 3.0 碰到一些问题,用作记录 VUE-CLI 3.0...

  • 利用 jcli 管理 Jenkins

    原文地址:https://jenkins.io/zh/blog/2019/08/30/jenkins-cli/ 作...

  • Jenkins使用记录

    这几天在家远程办公,然后公司的Jenkins又抽筋了,Jenkins的服务器跟SVN服务器连接不上,搞得我每次都要...

  • Ubuntu Jenkins+gitlab使用

    最近开始接触Jenkins,本文将记录一些使用的方法以备日后参考使用。环境为VM ubuntu Jenkins安装...

  • Jenkins CLI 命令行 v0.0.23

    本文首发于:Jenkins 中文社区 作者:Zhao Xiaojie Jenkins CLI 在参加 2019 年...

网友评论

      本文标题:Jenkins CLI 使用记录

      本文链接:https://www.haomeiwen.com/subject/gselrktx.html