問題描述
我的團(tuán)隊目前正在嘗試自動部署我們的 .Net 和 PHP 網(wǎng)絡(luò)應(yīng)用程序.我們希望簡化部署,避免手動部署帶來的麻煩和許多麻煩.
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
我們所有的應(yīng)用程序都使用 SVN 進(jìn)行源代碼控制,我們的 .Net 應(yīng)用程序使用 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?
推薦答案
謝謝大家的好建議.我們檢查了所有這些,但經(jīng)過仔細(xì)考慮后,我們決定將 CruiseControl、NAnt、MSBuild 和 MSDeploy 結(jié)合起來推出自己的產(chǎn)品.
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:
- 開發(fā)人員構(gòu)建應(yīng)用的調(diào)試"版本并運(yùn)行單元測試,然后簽入 SVN.
- CruiseControl 看到更新并調(diào)用我們的構(gòu)建腳本...
- 在構(gòu)建數(shù)據(jù)庫上運(yùn)行任何新的遷移
- 用構(gòu)建服務(wù)器配置替換配置文件
- 構(gòu)建應(yīng)用的調(diào)試"配置
- 運(yùn)行所有單元和集成測試
- 構(gòu)建應(yīng)用的部署"配置
- 使用當(dāng)前主要/次要版本和 SVN 修訂版對 DLL 進(jìn)行版本控制,例如1.2.0.423
- 將此新構(gòu)建移動到我們構(gòu)建服務(wù)器上的發(fā)布"文件夾
- 刪除不需要的文件
然后,當(dāng)我們確認(rèn)一切都準(zhǔn)備好進(jìn)行直播/登臺時,我們運(yùn)行另一個腳本:
Then when we have verified everything is ready to go up to live/staging we run another script to:
- 在實時/臨時服務(wù)器上運(yùn)行遷移
- MSDeploy:存檔當(dāng)前的實時/臨時站點(diǎn)
- MSDeploy:將站點(diǎn)從構(gòu)建同步到實時/暫存
到這個階段還不是很順利,但現(xiàn)在大部分時間都在發(fā)揮作用:D
It wasn't pretty getting to this stage, but it's mostly working like a charm now :D
隨著我們對流程進(jìn)行更改,我將嘗試更新此答案,因為現(xiàn)在似乎有幾個關(guān)于 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.
這篇關(guān)于自動部署 Web 應(yīng)用程序?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!