安装Java8,Git,和Jenkins及插件。
jenkins安装后以windows服务的方式运行,浏览器访问本机8080端口可访问。
自动部署的原理分为三步,首先从git服务器获取最新代码,然后用dotnet命令发布代码,最后将代码copy到网站目录。
cd "%WORKSPACE%Cube.App.WebApiEDS.WebApi"
dotnet publish -o "D:jenkinspublish\%JOB_NAME%\%BUILD_NUMBER%"
C:WindowsSystem32inetsrvappcmd.exe stop apppool /apppool.name:"CubeApp"
xcopy "D:jenkinspublish\%JOB_NAME%\%BUILD_NUMBER%" "D:WebSiteApp Service" /s/e/y/exclude:D:jenkinsexclude.txt
C:WindowsSystem32inetsrvappcmd.exe start apppool /apppool.name:"CubeApp"
版本号旁边的箭头可以查看控制台输出,可用来排查错误