Automate Deployment for Web Applications? [closed]

余生颓废 提交于 2019-12-17 17:24:02

问题


My team is currently trying to automate the deployment of our .Net and PHP web applications. We want to streamline deployments, and to avoid the hassle and many of the headaches caused by doing it manually.

We require a solution that will enable us to:

- Compile the application  
  - Version the application with the SVN version number
  - Backup the existing site
  - Deploy to a web farm

All our apps are source controlled using SVN and our .Net apps use CruiseControl. We have been trying to use MSBuild and NAnt deployment scripts with limited success. We have also used Capistrano in the past, but wish to avoid using Ruby if possible.

Are there any other deployment tools out there that would help us?


回答1:


Thank you all for your kind suggestions. We checked them all out, but after careful consideration we decided to roll our own with a combination of CruiseControl, NAnt, MSBuild and MSDeploy.

This article has some great information: Integrating MSBuild with CruiseControl.NET

Here's roughly how our solution works:

  • Developers build the 'debug' version of the app and run unit tests, then check in to SVN.
  • CruiseControl sees the updates and calls our build script...
    • Runs any new migrations on the build database
    • Replaces the config files with the build server config
    • Builds the 'debug' configuration of the app
    • Runs all unit and integration tests
    • Builds the 'deploy' configuration of the app
      • Versions the DLLs with the current major/minor version and SVN revision, e.g. 1.2.0.423
      • Moves this new build to a 'release' folder on our build server
      • Removes unneeded files
    • Updates IIS on the build server if required

Then when we have verified everything is ready to go up to live/staging we run another script to:

  • Run migrations on live/staging server
  • MSDeploy: archive current live/staging site
  • MSDeploy: sync site from build to live/staging

It wasn't pretty getting to this stage, but it's mostly working like a charm now :D

I'm going to try and keep this answer updated as we make changes to our process, as there seem to be several similar questions on SA now.




回答2:


I have used Visual Build Pro for years, It's quite slick and easy to use and has many standard operations (like the ones you mentioned) built in.




回答3:


I use Puppet, Makefiles to build RPMs and Bamboo to do this for me. My system doesn't directly apply, and I'm not to familiar with the Windows world, but there are some transferable patterns.

My make setup allows me to build RPM's for everything (php libs, php websites, perl modules, C apps, etc) that make up my app. This can be called manually, or through Bamboo. I transfer these RPM's into a yum repo and puppet handles making sure the latest (or correct) versions of software are installed in the cluster.

Could you automate building software packages into MSI's? I think Puppet can manage installation of software packages and versions in Windows.




回答4:


I use msdeploy for this. It works perfect.

About Ant; for the .NET platform we have NAnt and you can use it in combination with MSDeploy; you have the possibility to call MSDeploy from your Nant-script.

Edited: Just to make things clear; you can do everything with msdeploy. Using Nant is not a requirement.




回答5:


Rather than using xcopy we managed to use the -source:dirpath command with UNC addresses to the servers with msdeploy. The key was the ignoreAcls=true and removing calls to username and password in the msdeploy string:

msdeploy -verb:sync -source:dirpath=\\build\e$\app -dest:dirpath=\\live\d$\app,ignoreAcls=true

The example deploys the site from our build server's E drive to the D drive on our live server. There are some security considerations with exposing shares or this level of disk access on a live server. We're currently looking into using a limited access shared folder.

We then pipe this output to a log file which is then moved to the backup archive for reference. The log file records which files were moved and when.Continuing the example above with the output pipe command:

... > E:\archive\msdeploy.log



回答6:


No one mentioned Final Builder http://www.finalbuilder.com. Its on par with Visual build Pro. Good GUI for creating automated build deployment harnesses




回答7:


Fabric. Seems small, simple, procedural. Written in Python, since Ruby is a no-no (why?).




回答8:


Check out Setup Factory (from indigo rose). It's pretty robust in what it can do. It uses the Windows installer API. It can probably do what you need.




回答9:


The only reason Nant should exist is so that you have a framework similar to Ant in which we can write Tasks using the .NET set of languages. If you don't want to get a pure .NET developer to write custom Tasks, I can't see any reason you can't use Ant. Just because you write your application in a .NET language, doesn't mean you have to use a .NET build tool.



来源:https://stackoverflow.com/questions/45783/automate-deployment-for-web-applications

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!