問題描述
我正在開始一個 PHP 新項目,我很想從其他開發人員那里獲得一些關于他們首選的 PHP 部署策略的反饋.我很想將事情自動化一點,這樣一旦提交更改,它們就可以快速遷移到開發或生產服務器.
I'm beginning a new project in PHP and I'd love to get some feedback from other developers on their preferred strategy for PHP deployment. I'd love to automate things a bit so that once changes are committed they can be quickly migrated to a development or production server.
我有使用 Capistrano 和 Ruby 以及一些基本的 shell 腳本進行部署的經驗.
I have experience with deployments using Capistrano with Ruby as well as some basic shell scripting.
在我自己開始潛水之前,很高興聽到其他人如何在他們的項目中解決這個問題.
Before I dive head first on my own it would be great to hear how others have approached this in their projects.
目前,開發人員在站點的本地安裝上工作,并將更改提交到 subversion 存儲庫.初始部署是通過從 svn 導出標記版本并將其上傳到服務器來進行的.
Currently developers work on local installations of the site and commit changes to a subversion repository. Initial deployments are made by exporting a tagged release from svn and uploading that to the server.
額外的更改通常是通過手動上傳更改的文件來逐步完成的.
Additional changes are typically made piecemeal by manually uploading changed files.
推薦答案
對于 PHP、SVN 和 Phing 構建腳本是要走的路.Phing 類似于 ANT 但是是用 PHP 編寫的,這使得 PHP 開發人員可以更輕松地修改需要.
For PHP, SVN with Phing build scripts are the way to go. Phing is similar to ANT but is written in PHP, which makes it much easier for PHP developers to modify for their needs.
我們的部署流程如下:
- 每個人在工作時都在同一臺本地服務器上進行開發,每個開發人員在他家里的機器上也有一個結賬.
- 提交會觸發一個提交后掛鉤,用于更新臨時服務器.
- 測試在臨時服務器上運行,如果通過 - 繼續.
- Phing 構建腳本已運行:
- 關閉生產服務器,將域切換到正在建設中"頁面
- 在生產結帳時運行 SVN 更新
- 運行架構增量腳本
- 運行測試
- 如果測試失敗 - 運行回滾腳本
- 如果測試通過,服務器將返回生產結帳
還有 phpUnderControl,這是一個持續集成服務器.老實說,我沒有發現它對網絡項目很有用.
There's also phpUnderControl, which is a Continuous Integration server. I didn't find it very useful for web projects to be honest.
這篇關于您首選的 php 部署策略是什么?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!