当前位置:网站首页>Jenkins cli command details
Jenkins cli command details
2022-07-24 16:23:00 【Brother Xing plays with the clouds】
The author 《 adopt CLI management Jenkins Server》 How to pass the SSH Or client command line management Jenkins Server, Limited to space , The main purpose of the previous article is to introduce the connection Jenkins Server The way . This paper mainly introduces Jenkins Server Common commands provided .
This article mainly demonstrates that SSH The way to perform common Jenkins CLI command , About passing SSH Connect Jenkins Server The content of , Please refer to the above . explain : The demo environment for this article is Ubuntu 16.04.
from who-am-i Start
$ ssh -l jack -p 8090 192.168.21.145 who-am-iobtain Jenkins Server Version of
$ ssh -l jack -p 8090 192.168.21.145 versionadd to agent
create-node The command needs to specify a xml File as parameter , This xml New... Is saved in the file node Configuration information . For convenience, we can use get-node Command to get an existing node Configuration file for , Then modify the configuration , And ultimately used to create new node. For example, we currently have a project named testagent Of node:
Use the following command to get its configuration information :
$ ssh -l jack -p 8090 192.168.21.145 get-node testagent > testagent.xmlNext, make a copy testagent.xml file , establish myagent.xml file , And modify it myagent.xml Related configuration in file . For example agent Change the name to myagent,host Change to new agent Of IP Address ,credentialsId Change to new with appropriate permissions ID. Finally, use the new myagent.xml File creation node:
$ ssh -l jack -p 8090 192.168.21.145 create-node < myagent.xmlSo new node And we're done . Of course , We can also use delete-node Command to delete a node.
install plugin
Jenkins Actions provided by default plugin Of CLI Only list-plugins and install-plugin.list-plugins Used to list all installed plugins:
$ ssh -l jack -p 8090 192.168.21.145 list-pluginsIf list-plugins Specify the parameters ( The name of the plug-in ), Then only the information of the plug-in is displayed , If the plug-in does not exist, an error will be reported :
install-plugin The command is used to install plug-ins : install-plugin SOURCE ... [-deploy] [-name VAL] [-restart] According to the designation source Options , Respectively from URL、 Local files and update center Installing a plug-in . The default from the update center Installing a plug-in , Only specify the short name of the plug-in (ID) That's all right. :
$ ssh -l jack -p 8090 192.168.21.145 install-plugin greenballs -deploy-deploy It means to deploy the plug-in immediately without waiting for the next restart Jenkins.
If the specified plug-in already exists and needs to be upgraded to a new version , Do the same install-plugin Just order :
$ ssh -l jack -p 8090 192.168.21.145 install-plugin pipeline-graph-analysis -restart-restart Option means restart after installation Jenkins.
etc. Jenkins After restart , It is found that the plug-in has been updated to the latest version :
Be careful :update center When installing the plug-in , It will automatically install the plug-ins that the current plug-in depends on .
Install plug-ins through local files download greenballs Plug in to the current directory , And then execute the command :
$ ssh -l jack -p 8090 192.168.21.145 install-plugin = -deploy < greenballs.hpi -name greenballsBe careful , You need to pass -name Option specifies the name of the plug-in .
job operation
Jenkins CLI Provides a wealth of commands to operate job: list-jobs: List all by default job get-job: Get assigned job Configuration file for copy-job: With existing job Create a new... For the template job create-job: Create a new job, Take the content in the standard input as the configuration information update-job: Update with the content in the configuration file job delete-job: Delete job enable-job:enable job disable-job:disable job although job There are many commands involved in the operation , But they are relatively simple , I'm not going to show you one by one .
Trigger job
build The command is used to trigger a job Mission , We can go through help Order to check build Help documentation for commands :
$ ssh -l jack -p 8090 192.168.21.145 help buildAccording to the above documents , Can pass -f and -v Execution of option synchronization job And get console output :
$ ssh -l jack -p 8090 192.168.21.145 build test -f -vsummary
Jenkins CLI There are many commands supported by default , Here are just a few of them , The main purpose is to help understand Jenkins CLI Basic usage of commands . For more detailed usage of commands, please refer to the official documents .
Reference resources : Jenkins CLI
边栏推荐
- JUC源码学习笔记3——AQS等待队列和CyclicBarrier,BlockingQueue
- 31 next spread
- Dynamics 365: how to get the threshold value of executemullerequest in batch requests
- Public and private key transmission, and understanding of CA certificate
- Replace the image source of Debian full version with Alibaba cloud image source
- 22 bracket generation
- Leetcode 223. rectangular area
- Custom view - Custom button
- About SQL data query statements
- Code shoe set - mt2093 · palindrome digit
猜你喜欢

Yolov6 trains its own data set

Will the capital market be optimistic about TCL's folding screen story?

Machine learning notes - building a recommendation system (5) feedforward neural network for collaborative filtering

Research on the efficiency of numpy array access

聊聊C指针

Knowledge points of MySQL (12)

Adaptive design and responsive design

如何在 PHP 中防止 XSS

Dynamics crm: mailbox configuration (III) - configure email server profiles and mailboxes

矩阵的秩和图像的秩的一些了解
随机推荐
2.19 haas506 2.0开发教程 - bluetooth - 蓝牙通信(仅支持2.2以上版本)
MySQL write lock does not take effect
Enter a URL to this page to show it. What happened in this process?
Azure key vault (1) Introduction
狗牙根植物介绍
Qt键盘事件(二)——长按按键反复触发event事件问题解决
TCP protocol debugging tool tcpengine v1.3.0 tutorial
栈与队列——1047. 删除字符串中的所有相邻重复项
Talk about C pointer
JUC源码学习笔记3——AQS等待队列和CyclicBarrier,BlockingQueue
双指针滑动窗口法解析及LeetCode相关题解
安信证券开户在手机开户安全吗?
deepin任务栏消失解决方法
“天上天下,唯我独尊”——单例模式
Qt设计机器人仿真控制器——按键控制机器人关节转动
Meizu blood exchange: Alibaba quits? Zhuhai SASAC joins the Bureau, and Huang Zhang hands over the controlling stake! Li Nan is removed from the main staff!
Jenkins CLI 命令详解
[SWT] user defined data table
如何防止跨站点脚本 (XSS) 攻击完整指南
Dynamics 365: explain virtual entity from 0 to 1