背景:我的Jenkins Master没有Docker命令,但我需要去制作镜像,可以指定一台装有Docker命令的机器来完成这个任务
一、添加节点
   节点名称一般用执行机IP命名,这样看起来直观 
二、配置节点
2.1.参数说明
Name(名称):即节点名称
Description(描述):介绍该节点的作用,如Docker构建
#of executors(并发构建数):定义该节点可以执行多少并发构建作业
Remote root directory(远程工作目录):节点用来运行构建的作业的专用目录
Labels(标签):可以为一组节点设置同一标签,然后配置构建作业只运行在某个特定标签的从节点上。如操作系统(CentOS、Ubuntu、SUSE)
Usage(用法):配置使用该节点的程度
用法一:尽可能的使用这个节点(最常用)
- 当不指定执行机的时候,会去所有配置该用法的机器中找一台运行Job。
- 如脚本式Pipeline中写了node,就会随机选取一台执行机
用法二:只允许运行绑定到这台机器的Job
如果Job不指定该执行机,那么Job不会运行到这台执行机上  Launch method(启动方式):最常用的是通过ssh启动,需配置ssh凭据
 Availability(启动和停止从节点的时间):有三种选择,通常选第一种,尽量保持代理在线  Environment variables(环境变量):这些环境变量将传递到构建作业中  Tool Locations(配置工具位置):如JDK、Maven 
2.2.查看日志
 
三、在Job中指定执行机
 PS:如果没有“Restrict where this project can be run”选项,需要安装Restricted Registration插件
|