持续集成工具Jenkins学习总结
2015-12-19 15:39
477 查看
概述
持续集成(Continuous Integration,简称CI)是一种软件开发实践,团队开发人员每次都通过自动化的构建(编译、发布、自动化测试)来验证,从而尽早的发现集成错误。持续集成最大的优点是避免了传统模式在集成阶段的除虫会议(bug meeting),其要素包括统一的代码库、自动构建、自动测试、自动部署、频繁提交修改过的代码等。Jenkins的前身是Hudson,是基于Java开发的一种持续集成工具,是一个开源软件项目,主要用于:
持续、自动地构建/测试软件项目,如CruiseControl与DamageControl;
监控一些定时执行的任务;
Jenkins的官网:http://jenkins-ci.org/,下面我总结一下Windows下Jenkins的安装和使用。
Jenkins安装
(1)安装素材
JDK(Jenkins运行需要Java 1.6以上的版本)Jenkins安装包(官网下载)
(2)安装JDK
(3)安装Jenkins
运行Jenkins安装包,按提示安装即可,安装成功之后会自动打开网页http://localhost:8080/,Jenkins主界面如下所示:Started by user anonymous Building in workspace D:\Program Files\Jenkins\jobs\JenkinsTest\workspace > D:\Program Files\Git\bin\git.exe rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository > D:\Program Files\Git\bin\git.exe config remote.origin.url https://github.com/GaoHongchen/WinFormGit.git # timeout=10 Fetching upstream changes from https://github.com/GaoHongchen/WinFormGit.git > D:\Program Files\Git\bin\git.exe --version # timeout=10 > D:\Program Files\Git\bin\git.exe -c core.askpass=true fetch --tags --progress https://github.com/GaoHongchen/WinFormGit.git +refs/heads/*:refs/remotes/origin/* > D:\Program Files\Git\bin\git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10 > D:\Program Files\Git\bin\git.exe rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10 Checking out Revision 2562db18b228c399d3d0e14f83ce305f09f64be1 (refs/remotes/origin/master) > D:\Program Files\Git\bin\git.exe config core.sparsecheckout # timeout=10 > D:\Program Files\Git\bin\git.exe checkout -f 2562db18b228c399d3d0e14f83ce305f09f64be1 > D:\Program Files\Git\bin\git.exe rev-list 2562db18b228c399d3d0e14f83ce305f09f64be1 # timeout=10 Path To MSBuild.exe: C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe Executing the command cmd.exe /C " C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /t:Rebuild /property:Configuration=Release;TargetFrameworkVersion=v4.0 "%WORKSPACE%\WinFormGit\WinFormGit.sln" " && exit %%ERRORLEVEL%% from D:\Program Files\Jenkins\jobs\JenkinsTest\workspace [workspace] $ cmd.exe /C " C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /t:Rebuild /property:Configuration=Release;TargetFrameworkVersion=v4.0 "%WORKSPACE%\WinFormGit\WinFormGit.sln" " && exit %%ERRORLEVEL%% Microsoft(R) 生成引擎版本 4.0.30319.17929 [Microsoft .NET Framework 版本 4.0.30319.18052] 版权所有(C) Microsoft Corporation 2007。保留所有权利。 Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. 生成启动时间为 2015/12/19 15:23:19。 项目“D:\Program Files\Jenkins\jobs\JenkinsTest\workspace\WinFormGit\WinFormGit.sln”在节点 1 上(Rebuild 个目标)。 ValidateSolutionConfiguration: 正在生成解决方案配置“Release|x86”。 项目“D:\Program Files\Jenkins\jobs\JenkinsTest\workspace\WinFormGit\WinFormGit.sln”(1)正在节点 1 上生成“D:\Program Files\Jenkins\jobs\JenkinsTest\workspace\WinFormGit\WinFormGit\WinFormGit.csproj”(2) (Rebuild 个目标)。 CoreClean: 正在删除文件“D:\Program Files\Jenkins\jobs\JenkinsTest\workspace\WinFormGit\WinFormGit\bin\Release\WinFormGit.exe”。 正在删除文件“D:\Program Files\Jenkins\jobs\JenkinsTest\workspace\WinFormGit\WinFormGit\bin\Release\WinFormGit.pdb”。 正在删除文件“D:\Program Files\Jenkins\jobs\JenkinsTest\workspace\WinFormGit\WinFormGit\obj\x86\Release\WinFormGit.csprojResolveAssemblyReference.cache”。 正在删除文件“D:\Program Files\Jenkins\jobs\JenkinsTest\workspace\WinFormGit\WinFormGit\obj\x86\Release\WinFormGit.Form1.resources”。 正在删除文件“D:\Program Files\Jenkins\jobs\JenkinsTest\workspace\WinFormGit\WinFormGit\obj\x86\Release\WinFormGit.Properties.Resources.resources”。 正在删除文件“D:\Program Files\Jenkins\jobs\JenkinsTest\workspace\WinFormGit\WinFormGit\obj\x86\Release\WinFormGit.csproj.GenerateResource.Cache”。 正在删除文件“D:\Program Files\Jenkins\jobs\JenkinsTest\workspace\WinFormGit\WinFormGit\obj\x86\Release\WinFormGit.exe”。 正在删除文件“D:\Program Files\Jenkins\jobs\JenkinsTest\workspace\WinFormGit\WinFormGit\obj\x86\Release\WinFormGit.pdb”。 ResolveAssemblyReferences: 将生成 TargetFramework 配置文件排除列表。 CoreResGen: "c:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\resgen.exe" /useSourcePath /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\Microsoft.CSharp.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\mscorlib.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Core.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Data.DataSetExtensions.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Data.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Deployment.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Drawing.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Windows.Forms.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Xml.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Xml.Linq.dll" /compile Form1.resx,obj\x86\Release\WinFormGit.Form1.resources Properties\Resources.resx,obj\x86\Release\WinFormGit.Properties.Resources.resources 正在将资源文件“Form1.resx”处理到“obj\x86\Release\WinFormGit.Form1.resources”中。 正在将资源文件“Properties\Resources.resx”处理到“obj\x86\Release\WinFormGit.Properties.Resources.resources”中。 GenerateTargetFrameworkMonikerAttribute: 正在跳过目标“GenerateTargetFrameworkMonikerAttribute”,因为所有输出文件相对于输入文件而言都是最新的。 CoreCompile: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /platform:x86 /errorreport:prompt /warn:4 /define:TRACE /highentropyva- /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\Microsoft.CSharp.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\mscorlib.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Core.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Data.DataSetExtensions.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Data.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Deployment.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Drawing.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Windows.Forms.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Xml.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Xml.Linq.dll" /debug:pdbonly /filealign:512 /optimize+ /out:obj\x86\Release\WinFormGit.exe /resource:obj\x86\Release\WinFormGit.Form1.resources /resource:obj\x86\Release\WinFormGit.Properties.Resources.resources /target:winexe /utf8output Form1.cs Form1.Designer.cs Program.cs Properties\AssemblyInfo.cs Properties\Resources.Designer.cs Properties\Settings.Designer.cs "C:\Windows\TEMP\.NETFramework,Version=v4.0,Profile=Client.AssemblyAttributes.cs" CopyFilesToOutputDirectory: 正在将文件从“obj\x86\Release\WinFormGit.exe”复制到“bin\Release\WinFormGit.exe”。 WinFormGit -> D:\Program Files\Jenkins\jobs\JenkinsTest\workspace\WinFormGit\WinFormGit\bin\Release\WinFormGit.exe 正在将文件从“obj\x86\Release\WinFormGit.pdb”复制到“bin\Release\WinFormGit.pdb”。 已完成生成项目“D:\Program Files\Jenkins\jobs\JenkinsTest\workspace\WinFormGit\WinFormGit\WinFormGit.csproj”(Rebuild 个目标)的操作。 已完成生成项目“D:\Program Files\Jenkins\jobs\JenkinsTest\workspace\WinFormGit\WinFormGit.sln”(Rebuild 个目标)的操作。 已成功生成。 0 个警告 0 个错误 已用时间 00:00:00.47 Finished: SUCCESS
Console Output
最终,项目构建状态如下:
为了配置好Jenkins,我可是构建了12次啊。虽然花费了不少时间,但学会了用Jenkins持续集成,这还是令人高兴的,哈哈。。。
相关文章推荐
- LeetCode 28:Implement strStr()
- ELK安装文档及相关优化
- 黑马程序员-OC语言-关键字self与super
- Numerical Analysis - Quadrature - Newton-Cotes Formulas
- Python Network Programming(3)---通过指定的端口和协议找到服务名
- 【Ubuntu】命令行下载安装JDK
- x-forward-for 取客户端ip
- Qt之Q_PROPERTY宏定义二
- zzuli OJ 1128: 课程平均分
- 贪心第二弹!SHU1974 这架飞机被虫虫承包了
- 从《收获》看纯文学期刊的生存之路
- jQuery插件开发的五种形态[转]
- Apache
- Struts获取jsp页面遍历出来的数据id
- 杨辉三角
- 108,Foundation
- zzuli OJ 1127: 矩阵乘积
- http://www.cnblogs.com/yanhan/archive/2013/01/26/2877889.html
- JavaScript数组
- Git和GitHub原理讲解及区别