这里是我结束了解决这一问题至今:
源代码目录:
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