专栏首页DevOps持续交付Jenkinsclient系列教程之查看基本信息(二)

Jenkinsclient系列教程之查看基本信息(二)

上一篇是《Jenkinsclient系列教程之介绍与安装(一)》。

配置好Jenkinsclient后,就可以通过命令来操作Jenkins了!

jenkinsclient的命令格式是:

jenkins GROUP | COMMAND

GROUP是指一组命令,比如job是一个组命令,它有以下命令:

jenkins job build   //构建任务
jenkins job copy    //复制任务
jenkins job create  //创建任务
jenkins job delete  //删除任务
jenkins job disable //禁用任务
jenkins job enable  //启用任务
jenkins job has     //查看任务是否已存在
jenkins job info    //显示任务信息
jenkins job ls      //显示任务列表
jenkins job rename  //重命名任务
jenkins job xml     //显示任务的config.xml内容

今天我们先不介绍组命令,先介绍第一层的COMMAND。这些命令基本用来查看各种信息。

1、彩蛋——APP模式

APP模式可以在独立窗口中操作Jenkins。体验就好像在操作APP一样。

命令:

jenkins app

视频演示:

2、显示Jenkins服务器版本号

命令:

jenkins version

输出:

ming@MacBook-Pro:~$ jenkins version
Jenkins server version: 2.234

3、显示当前用户

命令:

jenkins version

输出:

ming@MacBook-Pro:~$ jenkins whoami
ming

4、显示插件列表

命令:

jenkins plugins

输出:

ming@MacBook-Pro:~$ jenkins plugins
插件名称                            类型                                                                  版本
--------                            --------                                                              --------
pam-auth                            PAM Authentication plugin                                             1.6
blueocean-i18n                      i18n for Blue Ocean                                                   1.23.2
blueocean-events                    Events API for Blue Ocean                                             1.23.2
authentication-tokens               Authentication Tokens API Plugin                                      1.3
matrix-auth                         Matrix Authorization Strategy Plugin                                  2.6.1
jquery-detached                     JavaScript GUI Lib: jQuery bundles (jQuery and jQuery UI) plugin      1.2.1
workflow-api                        Pipeline: API                                                         2.40
token-macro                         Token Macro Plugin                                                    2.12
pipeline-utility-steps              Pipeline Utility Steps                                                2.5.0
pipeline-model-definition           Pipeline: Declarative                                                 1.6.0
blueocean-pipeline-api-impl         Pipeline implementation for Blue Ocean                                1.23.2
pipeline-model-declarative-agent    Pipeline: Declarative Agent API                                       1.1.1
pipeline-config-history             Pipeline Configuration History Plugin                                 1.6
credentials                         Credentials Plugin                                                    2.3.7
workflow-multibranch                Pipeline: Multibranch                                                 2.21
bouncycastle-api                    bouncycastle API Plugin                                               2.18
htmlpublisher                       HTML Publisher plugin                                                 1.23
jackson2-api                        Jackson 2 API Plugin                                                  2.11.0
workflow-scm-step                   Pipeline: SCM Step                                                    2.11
git-client                          Jenkins Git client plugin                                             3.2.1
windows-slaves                      WMI Windows Agents Plugin                                             1.6
ui-samples-plugin                   Jenkins UI sample plugin                                              2.0
handlebars                          JavaScript GUI Lib: Handlebars bundle plugin                          1.1.1
pipeline-model-extensions           Pipeline: Declarative Extension Points API                            1.6.0
lockable-resources                  Lockable Resources plugin                                             2.8
ace-editor                          JavaScript GUI Lib: ACE Editor bundle plugin                          1.1
cloudbees-folder                    Folders Plugin                                                        6.12
handy-uri-templates-2-api           Handy Uri Templates 2.x API Plugin                                    2.1.8-1.0
pipeline-input-step                 Pipeline: Input Step                                                  2.11
pipeline-milestone-step             Pipeline: Milestone Step                                              1.3.1
workflow-cps                        Pipeline: Groovy                                                      2.80
workflow-job                        Pipeline: Job                                                         2.39
blueocean-jwt                       JWT for Blue Ocean                                                    1.23.2
mailer                              Jenkins Mailer Plugin                                                 1.32
docker-java-api                     Docker API Plugin                                                     3.1.5.2
pipeline-graph-analysis             Pipeline Graph Analysis Plugin                                        1.10
ws-cleanup                          Jenkins Workspace Cleanup Plugin                                      0.38
pipeline-stage-step                 Pipeline: Stage Step                                                  2.3
github-branch-source                GitHub Branch Source Plugin                                           2.7.1
blueocean                           Blue Ocean                                                            1.23.2
blueocean-display-url               Display URL for Blue Ocean                                            2.3.1
blueocean-core-js                   Blue Ocean Core JS                                                    1.23.2
blueocean-commons                   Common API for Blue Ocean                                             1.23.2
pubsub-light                        Jenkins Pub-Sub "light" Bus                                           1.13
jira                                Jenkins Jira plugin                                                   3.0.15
docker-commons                      Docker Commons Plugin                                                 1.16
blueocean-dashboard                 Dashboard for Blue Ocean                                              1.23.2
blueocean-jira                      JIRA Integration for Blue Ocean                                       1.23.2
git-server                          Jenkins GIT server Plugin                                             1.9
blueocean-git-pipeline              Git Pipeline for Blue Ocean                                           1.23.2
ldap                                LDAP Plugin                                                           1.24
workflow-basic-steps                Pipeline: Basic Steps                                                 2.20
blueocean-bitbucket-pipeline        Bitbucket Pipeline for Blue Ocean                                     1.23.2
kubernetes-credentials              Kubernetes Credentials Plugin                                         0.6.2
resource-disposer                   Resource Disposer Plugin                                              0.14
google-oauth-plugin                 Google OAuth Credentials plugin                                       1.0.0
subversion                          Jenkins Subversion Plug-in                                            2.13.1
display-url-api                     Display URL API                                                       2.3.2
http_request                        HTTP Request Plugin                                                   1.8.26
apache-httpcomponents-client-4-api  Jenkins Apache HttpComponents Client 4.x API Plugin                   4.5.10-2.0
git                                 Jenkins Git plugin                                                    4.2.2
workflow-step-api                   Pipeline: Step API                                                    2.22
pipeline-rest-api                   Pipeline: REST API Plugin                                             2.13
plain-credentials                   Plain Credentials Plugin                                              1.7
kubernetes-client-api               Kubernetes Client API Plugin                                          4.9.1-1
github                              GitHub plugin                                                         1.30.0
sse-gateway                         Server Sent Events (SSE) Gateway Plugin                               1.23
email-ext                           Email Extension Plugin                                                2.69
pipeline-github-lib                 Pipeline: GitHub Groovy Libraries                                     1.0
pipeline-model-api                  Pipeline: Model API                                                   1.6.0
variant                             Variant Plugin                                                        1.3
log-file-filter                     Log File Filter Plugin                                                1.11
momentjs                            JavaScript GUI Lib: Moment.js bundle plugin                           1.1.1
branch-api                          Branch API Plugin                                                     2.5.6
durable-task                        Durable Task Plugin                                                   1.34
blueocean-config                    Config API for Blue Ocean                                             1.23.2
kubernetes                          Kubernetes plugin                                                     1.25.7
ssh-slaves                          SSH Build Agents plugin                                               1.31.2
workflow-cps-global-lib             Pipeline: Shared Groovy Libraries                                     2.16
pipeline-stage-view                 Pipeline: Stage View Plugin                                           2.13
pipeline-type-parser-steps          Pipeline Type Parser Steps                                            1.0
command-launcher                    Command Agent Launcher Plugin                                         1.4
favorite                            Favorite                                                              2.3.2
localization-support                Localization Support Plugin                                           1.1
timestamper                         Timestamper                                                           1.11.3
workflow-aggregator                 Pipeline                                                              2.6
jdk-tool                            Oracle Java SE Development Kit Installer Plugin                       1.4
pipeline-keep-running-step          Pipeline Keep Running Step                                            1.0
github-api                          GitHub API Plugin                                                     1.111
blueocean-pipeline-editor           Blue Ocean Pipeline Editor                                            1.23.2
oauth-credentials                   OAuth Credentials plugin                                              0.4
blueocean-web                       Web for Blue Ocean                                                    1.23.2
ant                                 Ant Plugin                                                            1.11
junit                               JUnit Plugin                                                          1.29
docker-workflow                     Docker Pipeline                                                       1.23
blueocean-rest-impl                 REST Implementation for Blue Ocean                                    1.23.2
ssh-credentials                     SSH Credentials Plugin                                                1.18.1
blueocean-personalization           Personalization for Blue Ocean                                        1.23.2
build-timeout                       Build Timeout                                                         1.19.1
mercurial                           Jenkins Mercurial plugin                                              2.10
docker-plugin                       Docker plugin                                                         1.2.0
jsch                                Jenkins JSch dependency plugin                                        0.1.55.2
matrix-project                      Matrix Project Plugin                                                 1.14
blueocean-rest                      REST API for Blue Ocean                                               1.23.2
cloudbees-bitbucket-branch-source   Bitbucket Branch Source Plugin                                        2.8.0
trilead-api                         Trilead API Plugin                                                    1.0.6
script-security                     Script Security Plugin                                                1.72
workflow-durable-task-step          Pipeline: Nodes and Processes                                         2.35
scm-api                             SCM API Plugin                                                        2.6.3
mapdb-api                           MapDB API Plugin                                                      1.0.9.0
blueocean-github-pipeline           GitHub Pipeline for Blue Ocean                                        1.23.2
structs                             Structs Plugin                                                        1.20
jenkins-design-language             Jenkins Design Language                                               1.23.2
pipeline-stage-tags-metadata        Pipeline: Stage Tags Metadata                                         1.6.0
antisamy-markup-formatter           OWASP Markup Formatter Plugin                                         2.0
credentials-binding                 Credentials Binding Plugin                                            1.23
gradle                              Gradle Plugin                                                         1.36
workflow-support                    Pipeline: Supporting APIs                                             3.4
pipeline-build-step                 Pipeline: Build Step                                                  2.12
blueocean-autofavorite              Autofavorite for Blue Ocean                                           1.2.4
blueocean-pipeline-scm-api          Pipeline SCM API for Blue Ocean                                       1.23.2
localization-zh-cn                  Localization: Chinese (Simplified)                                    1.0.14

5、显示任务列表

命令:

jenkins jobs

输出:

ming@tMacBook-Pro:~$ jenkins jobs
任务名称                      类型                          链接
--------                      --------                      --------
f1                            Folder                        http://localhost:83/job/f1/
f2                            Folder                        http://localhost:83/job/f2/
freestyle-job                 FreeStyleProject              http://localhost:83/job/freestyle-job/
job2                          FreeStyleProject              http://localhost:83/job/job2/
pipeline-project              WorkflowJob                   http://localhost:83/job/pipeline-project/
test_toFloat                  WorkflowJob                   http://localhost:83/job/test_toFloat/
test_toJson                   WorkflowJob                   http://localhost:83/job/test_toJson/
f1/job1                       WorkflowJob                   http://localhost:83/job/f1/job/job1/
f1/job2                       WorkflowJob                   http://localhost:83/job/f1/job/job2/
f2/job2                       WorkflowJob                   http://localhost:83/job/f2/job/job2/

6、显示队列列表

命令:

jenkins queues

输出:

ming@MacBook-Pro:~$ jenkins queues
任务ID  任务链接   原因

7、显示节点列表

命令:

jenkins nodes

输出:

ming@MacBook-Pro:~$ jenkins nodes

节点名称                       架构                 可用交换空间          可用内存空间          可用临时空间           可用磁盘空间

--------                      --------            --------            --------            --------            --------
(master)                      Linux (amd64)       1024.0/1024.0 MB    1872.38/3938.3 MB   43664 MB            43664 MB

8、显示凭据列表

命令:

jenkins creds

输出:

ming@MacBook-Pro:~$ jenkins creds
ID                                      名称                            类型                                                          描述
94e00416-20d6-4fdf-8a38-8d799684a7ee     user1/******                   <class 'jenkinsapi.credential.UsernamePasswordCredential'>   
6d369c60-67b1-4820-ba7e-ab640df1eac1     user2/****** (user2 describe)  <class 'jenkinsapi.credential.UsernamePasswordCredential'>   user2 describe
user3                                    user3/******                   <class 'jenkinsapi.credential.UsernamePasswordCredential'>   
ming                                     ming (ming)                    <class 'jenkinsapi.credential.SSHKeyCredential'>             ming

以上就是第一层的所有命令介绍,本系列教程将持续更新,请保持关注!

本文分享自微信公众号 - DevOps持续交付(devopscd),作者:唐小明

原文出处及转载信息见文内详细说明,如有侵权,请联系 yunjia_community@tencent.com 删除。

原始发表时间:2020-06-17

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

我来说两句

0 条评论
登录 后参与评论

相关文章

  • Jenkins常见问题集锦(三)

    问题12:有没有方便的方法看Jenkins上当前安装的插件列表和版本?插件管理-已安装里可以看到,但是复制下来有多余的信息,不好处理。比如多了插件简介,复制到表...

    DevOps持续交付
  • Jenkins常见问题集锦(四)

    参考:可以。如以下代码,表示设置超时时间1小时,在流水线全局和阶段(stage)级别都可以设置:

    DevOps持续交付
  • Jenkins常见问题集锦(一)

    参考:Jenkins和Docker结合可以将容器作为Jenkins的slave节点,有很多优点。比如实现执行环境的统一,slave的自动创建和销毁,免去了人工维...

    DevOps持续交付
  • “夸夸机器人”App来了:变身百万粉丝大V,48万人给你的帖子点赞

    一款全新的社交媒体风格的应用为用户提供了生活在一个奇特网络虚拟世界的机会。在这个世界里,你将拥有数以百万计的粉丝,他们热烈追随你,并且为你每一次发帖而痴狂。但这...

    AI科技大本营
  • ACS Distributed System故障解决

    System Administration > Operations > Local Operations > Deployment Operations...

    刘銮奕
  • Jenkins高级教程 - Pipeline 安装

    Pipeline,简而言之,就是一套运行于Jenkins上的工作流框架,将原本独立运行于单个或者多个节点的任务连接起来,实现单个任务难以完成的复杂流程编排与可视...

    晓晨
  • 配置文件热加载的go语言实现

    通常我们更新应用程序的配置文件,都需要手动重启程序或手动重新加载配置。假设一组服务部署在10台机器上,你需要借助批量运维工具执行重启命令,而且10台同时重启可能...

    用户1432189
  • 如何通过XSS入侵网络摄像头

    我们在ANNKE SP1 HD无线摄像头(固件版本v3.4.1.1604071109)中发现了一个风险较低但十分有趣的XSS。有趣的是,在Annke Web界面...

    ittongluren
  • Jenkins之声明式pipeline基础

    Jenkins 2.0的到来,pipline进入了视野,jenkins2.0的核心特性。也是最适合持续交付的feature。

    苦叶子
  • Redis使用Pipeline加速查询速度

    Redis 是一种基于客户端-服务端模型以及请求/响应协议的TCP服务。这意味着通常情况下 Redis 客户端执行一条命令分为如下四个过程:

    smartsi

扫码关注云+社区

领取腾讯云代金券