`
cuijiemin
  • 浏览: 256515 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

ControlTier+hudson之hudson总结

阅读更多

 

俺公司决定采用ControlTier+hudson实现自动化集成,还要俺们用手机登陆ControlTier控制台一键start。

下面是hudson比较有用的资料,想要和ControlTier集成就得用ssh commandline了。

下载hudson.war(带有web服务器),执行java -jar hudson.war,默认的HUDSON_HOME是用户$HOME/.hudson。
打开page:http://localhost:8080可以看到web界面,添加job之类可以直接在网页上进行。
个人觉得hudson对于cruisecontrol的好处在于:
1,更容易上手,不管是安装还是配置;
2,configure可以通过网页界面,也可以通过编辑xml文件(如果想跟cc一样);
3,大量的plugin可以直接拿来用,对于java程序,基本上要用到的plugin都已经有了,现在又增加了对cpp的支持的plugin。

hudson主页:https://hudson.dev.java.net/
plugin下载界面:https://hudson.dev.java.net/serv ... 5818&folderID=0
plugin介绍wiki:http://wiki.hudson-ci.org/display/HUDSON/Plugins (强烈推荐这个页面,会让你时常感到惊喜)
hudson如何支持分布式build:http://hudson.gotdns.com/wiki/display/HUDSON/Distributed+builds
hudson command line功能:http://wiki.hudson-ci.org/display/HUDSON/Hudson+CLI(第四页有更详细介绍)
hudson论坛:http://www.nabble.com/Hudson-f16871.html
一个有趣的页面,比较了大量的CI工具:http://confluence.public.thoughtworks.org/display/CC/CI+Feature+Matrix

wikipedia上搜Continuous integration的结果,很有用:http://en.wikipedia.org/wiki/Continuous_integration

关于怎么开始使用Hudson

1,下载hudson.war:
Hudson主页(链接在1楼) -> download;
2,安装:
确保你的机器上有java,需要1.5以上版本,1.4我之前试过一次貌似不行;
运行java -jar hudson.war;
3,完成,访问hudson界面:
http://localhost:8080

这个是介绍hudson的强大的plugin们页面:
http://wiki.hudson-ci.org/display/HUDSON/Plugins
你可以在里面看到各种plugin,
最强大的是post build publisher的plugin,有junit,cobertura,emma,javadoc,pmd,checkstyle,doxygen,cppunit,purecoverage等等。
还有版本控制系统的plugin,有clearcase的,hudson对cvs和svn的支持是不需要插件的。

plugin下载之后,可以用hudson自己的plugin control页面下载,也可以自己手动下载然后拷贝到HUDSON_HOME/plugin下面,重启hudson就可以了。然后你可以在job的 configure页面下对应的配置选项。publisher的plugin,以junit为例,把生成的test-result.xml所在路径填入选 项,例如path2junitresult/*.xml,然后build成功生成相对目录下的xml文件之后,hudson job里面就会出现test result的结果,点击进入就可以了。

总之,配置超级方便,plugin功能强大且不断更新。

惊喜的发现hudson cli的功能,支持更多的自动化,enjoy it:

http://wiki.hudson-ci.org/display/HUDSON/Hudson+CLI
http://n4.nabble.com/build-of-a- ... 989845.html#a989845

> java -jar ./.hudson/war/WEB-INF/hudson-cli.jar -s http://localhost:8080 help
groovy
Executes the specified Groovy script
copy-job
Copies a job
version
Shows the Hudson version
create-job
Creates a new job by reading stdin as a configuration XML file
install-plugin
Installs a plugin either from a file, an URL, or from update center
help
Lists all the available commands
mail
Reads stdin and sends that out as an e-mail.
groovysh
Runs an interactive groovy shell
install-tool
Performs automatic tool installation, and print its location to stdout. Can be only called from inside a build
build
Builds a job, and optionall waits until its completion.
delete-job
Deletes a job
disable-job
Disables a job
enable-job
Enables a job
quiet-down
Quiet down Hudson, in preparation for a restart. Don't start any builds.
cancel-quiet-down
Cancel the effect of the "quiet-down" command.
reload-configuration
Discard all the loaded data in memory and reload everything from file system. Useful when you modified config files directly on disk.
restart
Restart Hudson
clear-queue
Clears the build queue
keep-build
Mark the build to keep the build forever.

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics