這裏是我結束瞭解決這一問題至今:
源代碼目錄:
build/ - build files for phing and environment-specific properties files
build.xml
src_qa.properties - properties to use the qa server as the source for a deployment
dst_qa.properties - properties to use the qa server as the destination for a deployment
etc... for other environments
conf/ - contains environment specific configuration files, each in a subfolder named after the environment
dev/
db-config.php - config file for HyperDB - http://codex.wordpress.org/HyperDB
default - Apache conf that holds ServerAlias configs for multi-site WordPress
hosts - useful for developers to redirect their browser to various domains in different environments
htaccess.dist - for WPMU
httpd.conf - main Apache config file, specific to each environment
my.cnf - mysql config file
wp-config.php - main wordpress config file
qa
(same as dev/ but with different values in each file)
staging
(same as dev/ but with different values in each file)
prod
(same as dev/ but with different values in each file)
src/ - wordpress source code
wp-admin/
wp-content/
mu-plugins/
plugins/
themes/
wp-includes/
test/ - holds WP test suite and custom tests for plugins, themes, etc...
我使用哈德森CI服務器(http://hudson-ci.org/)以自動化和使用Subversion結賬任務手動構建,phing和phpunit等等......基本上,Hudson服務器根據你想要部署的內容從Subversion提取代碼,它是從CI服務器部署到目標服務器的rsync文件。
或者,對於從分段直接到生產的部署,Hudson rsync將文件從分段,到CI服務器,然後備份到生產。
我建立哈德森就業設置以下的功能塊:
core WP code - deploys core WP files and mu-plugins from src to dst
svn to qa
svn to staging
staging to prod
WP plugins/ folder - deploys only the plugins folder
svn to qa
svn to staging
staging to prod
WP themes/ folder - deploys the entire themes folder
svn to qa
svn to staging
svn to prod
Specific themes - deploys a specific theme (chosen through a drop down during the build process using Hudson's parameterized build feature - http://wiki.hudson-ci.org/display/HUDSON/Parameterized+Build)
svn to qa
svn to staging
svn to prod
哈德森工作也紛紛部署環境的具體PHP文件的能力(如WP-config.php文件,DB-配置。 php)以及Apache和MySQL配置文件到每個服務器上的適當位置。在某些情況下,我們將部署到多個Web服務器和多個數據庫服務器,並且通過phing構建文件和上面提到的.properties文件來處理大部分構建配置。未來,當我們有一個開發集成環境時,我們可能會在svn簽入任何代碼時進行自動部署。
該設置允許具有不同技能組織的不同開發人員(主要是CSS/HTML vs. PHP)獨立工作,並快速將代碼更改到正確的環境,而不涉及大量不必要的人員。 Hudson允許我鎖定不同的部署工作,以便只有合適的人才有權配置它們並啓動它們。
這是我設置的高級別概述,讓我知道你的想法。使用此設置最大的煩惱是在所有不同的服務器上使用rsync的密鑰對,用戶帳戶和文件權限。
戴夫
我認識了一幫鄉親使用Capistrano的與railsless的部署部署WordPress的http://theme.fm/2011/08/tutorial-deploying-wordpress-with-capistrano-2082/。儘管我已經成功完成了幾次,但仍未完全將其應用到我們的工作流程中。我覺得使用Git/GitHub作爲部署的基礎絕對是一個好方向。我們正在研究的另一個選項是http://beanstalkapp.com/features/deployments – jeffreynolte 2012-10-26 04:54:08