問題描述
我的團隊目前正在嘗試自動部署我們的 .Net 和 PHP 網絡應用程序.我們希望簡化部署,避免手動部署帶來的麻煩和許多麻煩.
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
我們所有的應用程序都使用 SVN 進行源代碼控制,我們的 .Net 應用程序使用 CruiseControl.我們一直在嘗試使用 MSBuild 和 NAnt 部署腳本,但收效甚微.我們過去也使用過 Capistrano,但希望盡可能避免使用 Ruby.
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?
推薦答案
謝謝大家的好建議.我們檢查了所有這些,但經過仔細考慮后,我們決定將 CruiseControl、NAnt、MSBuild 和 MSDeploy 結合起來推出自己的產品.
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.
這篇文章有一些重要的信息:將 MSBuild 與 CruiseControl.NET 集成
This article has some great information: Integrating MSBuild with CruiseControl.NET
以下是我們解決方案的大致工作原理:
Here's roughly how our solution works:
- 開發人員構建應用的調試"版本并運行單元測試,然后簽入 SVN.
- CruiseControl 看到更新并調用我們的構建腳本...
- 在構建數據庫上運行任何新的遷移
- 用構建服務器配置替換配置文件
- 構建應用的調試"配置
- 運行所有單元和集成測試
- 構建應用的部署"配置
- 使用當前主要/次要版本和 SVN 修訂版對 DLL 進行版本控制,例如1.2.0.423
- 將此新構建移動到我們構建服務器上的發布"文件夾
- 刪除不需要的文件
然后,當我們確認一切都準備好進行直播/登臺時,我們運行另一個腳本:
Then when we have verified everything is ready to go up to live/staging we run another script to:
- 在實時/臨時服務器上運行遷移
- MSDeploy:存檔當前的實時/臨時站點
- MSDeploy:將站點從構建同步到實時/暫存
到這個階段還不是很順利,但現在大部分時間都在發揮作用:D
It wasn't pretty getting to this stage, but it's mostly working like a charm now :D
隨著我們對流程進行更改,我將嘗試更新此答案,因為現在似乎有幾個關于 SA 的類似問題.
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.
這篇關于自動部署 Web 應用程序?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!