jenkins 添加slaveslave节点怎么向master传递数据

& 开源中国(OSChina.NET) |
开源中国社区(OSChina.net)是工信部
指定的官方社区二次元同好交流新大陆
扫码下载App
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
阅读(646)|
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
loftPermalink:'',
id:'fks_',
blogTitle:'Jenkins Master/Slave架构 (转)',
blogAbstract:'\r\n一 Jenkins Master/Slave架构\r\n&\r\n\r\nMaster/Slave相当于Server和agent的概念。Master提供web接口让用户来管理job和slave,job可以运行在master本机或者被分配到slave上运行。一个master可以关联多个slave用来为不同的job或相同的job的不同配置来服务。\r\n&\r\n&\r\n\r\n&\r\n当job被分配到slave上运行的时候,此时master和slave其实是建立的双向字节流的连接,其中连接方法主要有如下几种:\r\n\r\n1)master通过ssh来启动slave\r\nJenkins内置有ssh客户端实现,可以用来与远程的sshd通信,从而启动slave',
blogTag:'jenkins,master,slaver',
blogUrl:'blog/static/',
isPublished:1,
istop:false,
modifyTime:0,
publishTime:2,
permalink:'blog/static/',
commentCount:0,
mainCommentCount:0,
recommendCount:0,
bsrk:-100,
publisherId:0,
recomBlogHome:false,
currentRecomBlog:false,
attachmentsFileIds:[],
groupInfo:{},
friendstatus:'none',
followstatus:'unFollow',
pubSucc:'',
visitorProvince:'',
visitorCity:'',
visitorNewUser:false,
postAddInfo:{},
mset:'000',
remindgoodnightblog:false,
isBlackVisitor:false,
isShowYodaoAd:false,
hostIntro:'',
hmcon:'0',
selfRecomBlogCount:'0',
lofter_single:''
{list a as x}
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}2977人阅读
框架学习[CI](7)
有的时候不同job直接需要传递一个文件名或者路径,这个时候我们不需要传递文件实体,那这个路径如何传递呢?比如有如下两个项目,我想把A的工作目录传递给B,让B使用。
首先需要安装一个Parameterized Trigger Plugin插件:
安装后重启。
在A项目配置面板中Post-build Actions选项中选择Trigger parameterized build on other projects
我选择的参数为预定义参数,如果想知道有哪些与定义参数,可以在Build模块下选择Execute shell
选在文本框下的the list of available environment variables 选项,可以查看如下信息:
The following variables are available to shell scripts
BUILD_NUMBER
The current build number, such as "153"
The current build id, such as "_23-59-59" (YYYY-MM-DD_hh-mm-ss)
BUILD_DISPLAY_NAME
The display name of the current build, which is something like "#153" by default.
Name of the project of this build, such as "foo" or "foo/bar". (To strip off folder paths from a Bourne shell script, try: ${JOB_NAME
String of "jenkins-${JOB_NAME}-${BUILD_NUMBER}". Convenient to put into a resource file, a jar file, etc for easier identification.
EXECUTOR_NUMBER
The unique number that identifies the current executor (among executors of the same machine) that’s carrying out this build. This is the number you see in the "build executor status", except that the number starts from 0, not 1.
Name of the slave if the build is on a slave, or "master" if run on master
NODE_LABELS
Whitespace-separated list of labels that the node is assigned.
The absolute path of the directory assigned to the build as a workspace.
JENKINS_HOME
The absolute path of the directory assigned on the master node for Jenkins to store data.
JENKINS_URL
Full URL of Jenkins, like http://server:port/jenkins/ (note: only available if Jenkins URL set in system configuration)
Full URL of this build, like http://server:port/jenkins/job/foo/15/ (Jenkins URL must be set)
Full URL of this job, like http://server:port/jenkins/job/foo/ (Jenkins URL must be set)
SVN_REVISION
Subversion revision number that's currently checked out to the workspace, such as "12345"
Subversion URL that's currently checked out to the workspace.
ok,回到正题,具体配置如下:
我将A项目的工作目录传递给了自定义参数TEST_WORKSPACE.到这里A项目的配置就完成了。
我们在A项目配置的TEST_WORKSPACE参数,如果在B job中使用,首先我们在配置界面中,勾选The build is parameterized。具体配置信息如下所示:
这样我们就在当前工作环境中得到了由A传递过来的参数。至于你怎么使用,那是你的事了。比如我在shell脚本中首先切换到该目录下(需要在一台机器上),然后在A项目的工作目录下生成一个hello.txt文档,我们可以在shell命令下配置如下信息:
ok,配置完成了,这个时候我们构建A,看看能不能让B在A的工作目录下生成一个hello.txt文档。
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:619004次
积分:11229
积分:11229
排名:第858名
原创:455篇
评论:412条
阅读:13497
阅读:12819
文章:11篇
阅读:26676
文章:36篇
阅读:38349
阅读:7873
文章:31篇
阅读:42088
文章:17篇
阅读:25248
文章:24篇
阅读:35244
(4)(2)(1)(1)(7)(1)(12)(1)(5)(10)(39)(5)(10)(35)(12)(12)(17)(15)(52)(43)(18)(15)(12)(35)(34)(12)(25)(21)(12)

我要回帖

更多关于 jenkins slave agent 的文章

 

随机推荐