找到你要的答案

Q:Setting up TeamCity Deployment

Q:TeamCity部署设置

Probably a easy question..

So I have team city running on our dev server and Continuous integration is setup where it builds the project anytime a push is made to my GitHub repository. I'd like to have it set up to deploy the project to the IIS Site anytime a push is made.

Simple right.. I think I just need to add a build step with a build script(msbuild, nant, etc) which copies code to the IIS site's hosted directory.

So my question is where does my build script need to copy the files from? From git or I assume teamCity pulled code down from git in order to build the project... I just don't know where teamcity placed the files. does anyone know where teamCity places these files?

Does this sound right? Extra points if you have a script that does this.

Thank you!!!

可能是一个简单的问题..

所以我对我们团队的城市运行和持续集成开发服务器设置那里建立项目随时推了我的GitHub库。我想把它设置为项目部署到IIS站点随时推了。

简单吧..我想我只需要添加一个建立与构建脚本的步骤(MSBuild,楠,等),复制代码到IIS网站托管目录。

所以我的问题是我的构建脚本需要从哪里复制文件?从git或我认为TeamCity拉代码下Git为了建设项目…我只是不知道teamcity放文件。有人知道哪里TeamCity的地方这些文件吗?

Does this sound right? Extra points if you have a script that does this.

谢谢您!!!

answer1: 回答1:

You can do it a couple of different ways. For modern versions of TeamCity you can create a build step that will run against any of the standard 4 msbuild build targets (Build, Rebuild, Clean, Publish). If you include the Publish build target in your build step then TeamCity will deploy based on the settings on the Publish tab. This is the quickest and easiest way to go.

Teamcity checks out your code from source control and builds it in a folder local to the build agent that is running your build. If you have not installed any build agents on any other machines then the build agent is the one running on your Teamcity server. There are built in variables for the output location that you can use in your build steps, or you can specify your own if you want to build to a different output location.

If you want more flexibility then you'll need to develop a build script and there are nearly endless ways to do that.

你可以用几种不同的方法。现代版本的TeamCity可以创建一个生成步骤,将运行在任何标准的4(建设,重建MSBuild生成目标,清洁,发布)。如果你有在你的生成步骤,然后发布TeamCity将部署基于设置在发布表的构建目标。这是最快最容易的方法。

TeamCity检查代码从源头控制和建立文件夹中的本地生成代理,运行你的构建。如果你还没有安装任何其他机器,然后生成代理生成代理是一个在你TeamCity服务器上运行。您可以在生成步骤中使用输出变量的内置变量,或者如果您想构建到不同的输出位置,您可以指定自己的输出位置。

如果你想要更多的灵活性,那么你需要开发一个构建脚本,几乎没有办法做到这一点。

answer2: 回答2:

I would use a product such a OctopusDeploy to handle deployments for you. You can have this up and running and deploying in a few hours.

There's a plugin for TeamCity that'll create a nuget package for you that can then be pushed out to Octopus deploy with very little effort. You can then setup a project to deploy a website in Octopus and it'll do all the magic such as AppPool configuration, IIS Bindings etc. And you can deploy to multiple machines without having to repeat what you're doing.

IMO this is the best way of deploying .Net applications and I implement and use this with TeamCity on a daily basis for my clients.

Octopus Deploy

我会用一个产品这样的octopusdeploy来为您处理的部署。你可以在几个小时内启动并运行和部署。

有一个TeamCity,将创建一个NuGet包你可以推到章鱼部署用很少的努力,插件。然后你可以设置一个项目在部署网站章鱼就做所有的魔法如apppool配置IIS绑定等,您可以部署到多台机器无需重复你做的事情。

这是国际海事组织部署的最佳方式。NET应用程序和我实现和使用这个与我的客户每天TeamCity。

章鱼部署

answer3: 回答3:

Some basic recommendations how to setup deployment with TeamCity can be found here.

一些基本的建议如何安装部署TeamCity可以在这里找到。

git  iis  github  teamcity  continuous-deployment