当前位置:网站首页>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
边栏推荐
- Yolov4 trains its own data set
- 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
- 城市安全系列科普丨进入溺水高发期,救生常识话你知
- 【LOJ3247】「USACO 2020.1 Platinum」Non-Decreasing Subsequences(DP,分治)
- Replace the image source of Debian full version with Alibaba cloud image source
- 253 Conference Room II
- Cache penetration, cache breakdown, cache avalanche differences and solutions [easy to understand]
- 聊聊C指针
- torch_ How to use scatter. Scatter() in detail
- Who is the "roll" king of the prefabricated vegetable track?
猜你喜欢

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

VSCode如何鼠标滚轮放大界面

电话系统规则

【LOJ3247】「USACO 2020.1 Platinum」Non-Decreasing Subsequences(DP,分治)

TCP protocol debugging tool tcpengine v1.3.0 tutorial
[email protected]"/>ZBar project introduction and installation configuration| [email protected]

ARP 入门

机器学习笔记 - 构建推荐系统(5) 前馈神经网络用于协同过滤

多线程(基础)

Custom view - Custom button
随机推荐
About SQL data query statements
Dynamics 365: how to get the threshold value of executemullerequest in batch requests
How to generate complex flow chart of XMIND
Public and private key transmission, and understanding of CA certificate
Software - prerequisite software
Custom view - Custom button
REST风格
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
Code shoe set - mt2093 · palindrome digit
Druid integration shardingsphere appears xxmapper Reasons and solutions of XML error reporting
[loj3247] [USACO 2020.1 platinum "non declining subsequences (DP, divide and conquer)
Getting started with OpenMP
狗牙根植物介绍
安信证券开户在手机开户安全吗?
31 next spread
Urban safety series popular science - enter the high incidence period of drowning, if you know the common sense of life-saving
MySQL converts strings to numeric types and sorts them
PHP中array_merge的坑
[SWT] scrolling container to realize commodity list style
Some understanding of the rank sum of matrix and the rank of image