简体   繁体   English

ASP.NET网站项目,Mercurial / Git,部署 - 一种简单的方法?

[英]ASP.NET Web Site projects, Mercurial/Git, deployment - a simple way?

We have a small team of two developers (PC) and two designers (Mac). 我们有一个由两名开发人员(PC)和两名设计师(Mac)组成的小团队。 As we're an ad agency rather than a code shop we don't get to spend lots on software tools. 由于我们是一家广告代理商而非代码商店,因此我们不会在软件工具上投入大量资金。 We used to use Visual Studio years ago but now we use Visual Web Developer to create ASP.NET sites (.NET4 support - can't afford new VS licences). 我们以前使用Visual Studio几年前,但现在我们使用Visual Web Developer来创建ASP.NET站点(.NET4支持 - 无法承受新的VS许可证)。 We create the sites as Web Site projects (rather than Web Apps, or MVC) and we run on a dedicated dev box (Win 2008 rc2 server). 我们将网站创建为网站项目(而不是Web应用程序或MVC),我们在专用开发框(Win 2008 rc2服务器)上运行。

TortoiseHg is the latest I've been playing with and the difference between Hg and Git are negligibility considering our needs. TortoiseHg是我一直在玩的最新版本,考虑到我们的需求,Hg和Git之间的区别是可忽略的。 So we can run with either. 所以我们可以运行。

What I'm trying to do is find a relatively simple way of deploying sites/commits using freely available tools/services that works well with the tech/software that we use. 我正在尝试做的是找到一种使用免费提供的工具/服务部署站点/提交的相对简单的方法,这些工具/服务与我们使用的技术/软件配合得很好。

I don't mind lots of faffing to set up the solution if it can be setup up once on say one of our server but could deploy to multiple locations. 如果可以在我们的服务器上设置一次但可以部署到多个位置,我不介意设置解决方案。 I've been looking and CI server (Jenkins/Hudson) but they seem to be overkill for what we require. 我一直在寻找和CI服务器(Jenkins / Hudson),但他们似乎对我们的要求有点过分。 Do we need a build server for a 50 off web pages and associated assets? 我们是否需要一个50个网页和相关资产的构建服务器?

I tried the Mercurial HgWebDir setup thing - too many potential problems with Hg/Python versions and the setup time is too long per production server - I had to download the source, make a change and rebuild it... OTT. 我尝试了Mercurial HgWebDir安装程序 - Hg / Python版本的潜在问题太多,每个生产服务器的安装时间太长 - 我不得不下载源代码,进行更改并重建它... OTT。 Git seems to work best with SSH, again, more 3rd party stuff. Git似乎最适合SSH,再次,更多第三方的东西。

Is there any Windows based software that we can install on the production server or on a central server that will aid with simple deployment (ie copy latest changes to website directory and rollback) that doesn't cost the earth (preferably free) and doesn't rely on getting the right versions of this and that to work properly. 是否有任何基于Windows的软件,我们可以在生产服务器或中央服务器上安装,这将有助于简单部署(即复制网站目录和回滚的最新更改),这不会花费地球(最好免费)并且不会依靠获得正确版本的这个和那个正常工作。

Let's imagine that you have choosen AppHarbor for your .NET hosting. 让我们假设您已经为您的.NET托管选择了AppHarbor

They give you a GIT repository where you can have your source code and upon each push to appharbor they will automatically build your solution and make it available online. 他们为您提供了一个GIT存储库,您可以在其中获得源代码,每次push送到appharbor他们将自动构建您的解决方案并使其在线可用。

With this in mind, you can have a branch to be your production and everything else to help and to be used to host the source code and help files for example. 考虑到这一点,您可以拥有一个branch作为您的生产和其他一切帮助,并用于托管源代码和帮助文件。

If you choose a hosting company that only provide you with an FTP upload feature, either you use a automatic script to publish the data from your commit (using webhooks you can easily fire a web script that will pick up the changes (or the entire repo) and publish on the web). 如果您选择仅为您提供FTP上传功能的托管公司,您可以使用自动脚本从您的提交中发布数据(使用webhooks,您可以轻松触发将接收更改的Web脚本(或整个仓库) )并在网上发布)。

Either way is good, it's always up to you, what are you guys willing to try, and keep trying alternatives until all of you are happy with the result. 无论哪种方式都很好,它总是取决于你,你们有什么愿意尝试,并继续尝试替代方案,直到所有人都对结果感到满意为止。

With this, you can simply use Visual Studio and Tortoise GIT or even install GIT Extension in Visual Studio and use no more software... 有了这个,你可以简单地使用Visual StudioTortoise GIT ,甚至可以在Visual Studio中安装GIT Extension,不再使用软件......

Using Git with Visual Studio 在Visual Studio中使用Git

If deploying sites for you is "copy files from A to B" (no related build-process), you can try at least two methods, both assume the presence of working http-server on the "other" side 如果为您部署站点是“将文件从A复制到B”(没有相关的构建过程),您可以尝试至少两种方法,都假设在“其他”端存在工作的http-server

  1. Export from repository to unversioned tree, full clean-up of webspace, copy new files into site 从存储库导出到无版本树,完全清理网站空间,将新文件复制到网站
    • light-version of this solution: export only affected by changeset-range files and copy over old versions 此解决方案的轻型版本:导出仅受changeset-range文件影响并复制旧版本
  2. Site-space is part of working copy (I prefer to see repo outside the web-root), update of working copy (pull from somerepo ) updates files on site 站点空间是工作副本的一部分(我更喜欢在web-root之外看到repo),更新工作副本(从somerepo中提取 )更新站点上的文件

Only VCS + FTP|SCP|? 只有VCS + FTP | SCP |? clients used 客户使用

Have you considered using WebMatrix for development? 您是否考虑过使用WebMatrix进行开发? It helps streamline the process for small web sites like you describe. 它有助于简化您描述的小型网站的流程。

CI is still useful for small projects, especially if you use unit tests. CI对小项目仍然有用,特别是如果您使用单元测试。 Using Hudson in small Teams 在小团队中使用Hudson

You should be able to use git to deploy to your server and rollback quite easily. 您应该能够使用git部署到您的服务器并轻松回滚。 You could create a bare git repository on your server and then use the post-receive git hook to automatically deploy the changes. 您可以在服务器上创建一个裸git存储库,然后使用post-receive git hook自动部署更改。 So when you push changes to origin from your local repository, the website will be updated. 因此,当您从本地存储库将更改推送到源时,将更新网站。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM