代理人在詹金斯语中是什么意思? [英] What does the agent mean in jenkins?
问题描述
我正在尝试使用詹金斯.但是,当我阅读声明性管道语法时,我对'agent'感到困惑( https ://jenkins.io/doc/book/pipeline/syntax/#scripted-pipeline ).
I am trying to use jenkins. But when I reading the Declarative Pipeline Syntax, I confused by the 'agent'(https://jenkins.io/doc/book/pipeline/syntax/#scripted-pipeline).
- 代理代表什么?
- 这是否意味着我可以设置管道运行时文件夹路径?
- 如何创建代理?
- 如何为代理商设置标签?
推荐答案
我可以感觉到你的:-D. 答案如下:
I can feel you :-D. Here are the answers:
-
代理程序部分指定整个管道(或特定阶段)在Jenkins环境中的执行位置,具体取决于代理程序部分的放置位置.该部分必须在管道块内的顶层定义,但是阶段级别的用法是可选的. ( https://jenkins.io/doc/book/pipeline/syntax/#agent )
否,这与管道运行时文件夹路径无关.
NO this has nothing to do with the pipeline runtime folder path.
例如,您可以按照以下教程创建代理/节点: https://devopscube.com/setup-slaves-on-jenkins-2/一个> 但是还有许多其他创建代理的方法,例如使用Docker-Container(...).
You can for example Create an agent/node by following these tutorial: https://devopscube.com/setup-slaves-on-jenkins-2/ But there are many other ways to create an agent e.g. using a Docker-Container (...).
您可以在节点的配置"下设置标签. 您可以在管道中使用标签,例如:
You can Set a label under the Configuration of the Node. You can use a label in your pipeline like:
pipeline {
agent { label 'labelName' }
(...)
}
这篇关于代理人在詹金斯语中是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!