免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 10595 | 回复: 8
打印 上一主题 下一主题

hudson执行不了gmake [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-05-24 09:01 |显示全部楼层 |倒序浏览
Dear ALL
     我的hudson一个任务想执行gmake命令去编译后台的模块。hudson里面是这么配置的Execute shell->Command :/var/lib/hudson/build.sh -label $JOB_NAME-$BUILD_NUMBER
build.sh脚本如下:
#!/bin/bash

#OB_REL=/root/result

cd $WORKSPACE
echo "WORKSPACE:="$WORKSPACE;
gmake -f Makefile
cd $OB_REL
cd $OB_REL/lib
ls -tlr *.sl
dltest *.sl
能加载到WORKSPACE目录下,但是执行gmake不正确,手工执行没问题。
还请高人指点!

论坛徽章:
0
2 [报告]
发表于 2011-05-24 10:15 |显示全部楼层
回复 3# xiaopan3322


    1.HUDSON大家在Linux环境下面
    2.应该是我不太理解-label选项的意义 还望讲解下
    3.$WORKSPACE是HUDSON的任务工作区,没有加载到环境变量中,这个能shell脚本中应该能直接调用 $OB_REL是环境变量
    4.命令应该是在master上面执行
       [root@rhel142 hudson]# uname -a
Linux rhel142 2.6.18-128.2.1.el5 #1 SMP Wed Jul 8 11:54:47 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

论坛徽章:
0
3 [报告]
发表于 2011-05-24 10:40 |显示全部楼层
回复 5# xiaopan3322


    Started by user anonymous
[workspace] $ /bin/sh -xe /tmp/hudson8655029990995273156.sh
+ /var/lib/hudson/build.sh example-31
WORKSPACE:=/var/lib/hudson/jobs/example/workspace
Makefile:8: /etc/Tmp.mk: No such file or directory
Makefile:59: /etc/CALLmake: No such file or directory
gmake: *** No rule to make target `/etc/CALLmake'.  Stop.
ls: *.sl: No such file or directory
[dltest] ERROR dlopen: *.sl: cannot open shared object file: No such file or directory

Tmp.mk和CALLmake在$OB_REL的etc目录下面都有  而且本身Makefile定义的路径也定义在$(OB_REL)/etc/

论坛徽章:
0
4 [报告]
发表于 2011-05-24 10:56 |显示全部楼层
回复 7# xiaopan3322


    [root@rhel142 workspace]#
[root@rhel142 workspace]# echo $OB_REL
/root/result

论坛徽章:
0
5 [报告]
发表于 2011-05-24 11:17 |显示全部楼层
回复 9# xiaopan3322


    我试过把Makefile里面的$OB_REL直接换成绝对路径,但是出现下面的问恩
Makefile:8: /root/result/etc/Tmp.mk: Permission denied
Makefile:59: /root/result/etc/CALLmake: Permission denied

但是我在/root/result/etc/下面对着两个文件都是chmod 777的  这也是我到现在死活都想不明白的地方!

论坛徽章:
0
6 [报告]
发表于 2011-05-24 11:28 |显示全部楼层
回复 12# xiaopan3322


    [root@rhel142 etc]# ls -tlr Tmp.mk
-rwxrwxrwx 1 hudson hudson 1107 May 23 14:14 Tmp.mk
[root@rhel142 etc]# ls -tlr CALLmake
-rwxrwxrwx 1 hudson hudson 40613 May 23 14:14 CALLmake

我是在root用户下面启动hudson的  
[root@rhel142 etc]# ps -ef|grep hudson
root     26321     1  0 May23 ?        00:00:00 runuser -s /bin/bash - hudson -c ulimit -S -c 0 >/dev/null 2>&1 ; /usr/bin/java -Djava.awt.headless=true -DHUDSON_HOME=/var/lib/hudson -jar /usr/lib/hudson/hudson.war --logfile=/var/log/hudson/hudson.log --httpPort=8080 --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20
hudson   26322 26321  0 May23 ?        00:00:00 -bash -c ulimit -S -c 0 >/dev/null 2>&1 ; /usr/bin/java -Djava.awt.headless=true -DHUDSON_HOME=/var/lib/hudson -jar /usr/lib/hudson/hudson.war --logfile=/var/log/hudson/hudson.log --httpPort=8080 --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20
hudson   26346 26322  0 May23 ?        00:01:05 /usr/bin/java -Djava.awt.headless=true -DHUDSON_HOME=/var/lib/hudson -jar /usr/lib/hudson/hudson.war --logfile=/var/log/hudson/hudson.log --httpPort=8080 --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20
root     29804 28789  0 11:27 pts/0    00:00:00 grep hudson

论坛徽章:
0
7 [报告]
发表于 2011-05-24 12:36 |显示全部楼层
回复 14# xiaopan3322


    好的!谢了兄弟!

论坛徽章:
0
8 [报告]
发表于 2011-05-24 14:07 |显示全部楼层
回复 16# xiaopan3322


    我的QQ是424768587   方便的话QQ上说下!

论坛徽章:
0
9 [报告]
发表于 2011-05-24 15:06 |显示全部楼层
Dear ALL:
     该贴问题已经处理!因为编译需要用到环境变量OB_REL  但是hudson不认这个变量,所以在调用build脚本的时候找不到对应的路径。处理方法再系统管理的系统设置里面有个Environment variables  在这里加上OB_REL和对应的路径就可以了。谢谢xiaopan3322 (扛一肩记忆) 的帮助和指点!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP