当前位置:网站首页>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
边栏推荐
- Dongfang Guangyi refuted the rumor late at night, saying that the news that the hammer was filed for investigation was untrue!
- 多线程(基础)
- 做完数据治理,质量依旧很差
- G026-db-gs-ins-03 openeuler deployment opengauss (1 active and 2 standby or multiple standby)
- Complete guide on how to prevent cross site scripting (XSS) attacks
- Servlet框架(servlet+jsp)+Mysql实现的增删改查+分页(功能包学生信息录入、学生信息增删改查、分页等)
- 双指针滑动窗口法解析及LeetCode相关题解
- Software recommendation - office software
- 【LeetCode】Day102-螺旋矩阵 II
- 若依 this.$router.push 同地址不同参,页面不刷新问题
猜你喜欢
随机推荐
Some understanding of the rank sum of matrix and the rank of image
Cache penetration, cache breakdown, cache avalanche differences and solutions [easy to understand]
TCP协议调试工具TcpEngine V1.3.0使用教程
There are more than 20 categories of the four operators in MySQL. It took three days and three nights to sort them out. Don't collect them quickly
To create a private Ca, I use OpenSSL
城市安全系列科普丨进入溺水高发期,救生常识话你知
Azure key vault (1) Introduction
With regard to performance testing, dry goods hit "suggestions collection"
狗牙根植物介绍
MySQL converts strings to numeric types and sorts them
图片浏览器?Qt也可以实现!
Solution to deepin taskbar disappearance
Code shoe set - mt2093 · palindrome digit
Is it safe for Anxin securities to open an account on mobile phone?
Introduction to kettle messy notes
Withdrawal of IPO application, Yunzhou intelligent "tour" of unmanned boat enterprise fails to enter the science and Technology Innovation Board
解决Eureka默认缓存配置导致时效性问题
Knowledge points of MySQL (12)
Servlet framework (servlet+jsp) + addition, deletion, modification and query + paging implemented by MySQL (function package student information entry, addition, deletion, modification and query of st
如何防止跨站点脚本 (XSS) 攻击完整指南









