Dav*_*ris 12 php deployment wordpress wpmu
有没有人曾在不同地点与多个开发人员合作过WordPress项目?围绕分布式开发团队和自动部署是否有最佳实践?
我有一个不同程度的开发人员团队,包括插件开发人员,主题开发人员和简单的CSS风格调整器,在几个不同的位置,我想为每个人设置一个良好的系统,以便能够处理他们各自的部分和持续部署更改,而不会打扰其他任何人的代码.
系统目前正在运行WordPress-MU的安装,最终将升级到3.0.理想情况下,我们会将主题和插件存储在源代码控制中,并且由于对核心WordPress代码进行了一些修改,因此它也必须进入存储库.我无法找到构建存储库的最佳方法,并进行受控但有些自动化的部署.
当不同类型的插件和主题可以在文件系统或数据库中存储配置时,您如何处理工作和部署到开发,测试,登台和生产环境?我意识到答案可能是"不要使用WordPress",但假设我必须,让我知道你的想法,
谢谢你的帮助,
戴夫
以下是我到目前为止最终解决此问题的方法:
源代码目录:
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...
Run Code Online (Sandbox Code Playgroud)
我正在使用Hudson CI Server(http://hudson-ci.org/)使用subversion checkout任务,phing和phpunit等自动和手动构建......基本上,Hudson服务器从subversion中提取代码取决于什么您要部署,并且rsync是要从CI服务器部署到目标服务器的文件.
或者,在从直接升级到生产的部署的情况下,Hudson rsync将文件从登台,到CI服务器,然后备份到生产.
我在hudson中为以下功能构建了作业:
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
Run Code Online (Sandbox Code Playgroud)
hudson作业还能够将特定于环境的PHP文件(例如wp-config.php,db-config.php)以及Apache和MySQL配置文件部署到每台服务器上的适当位置.在某些情况下,我们部署到多个Web服务器和多个数据库服务器,并且大多数构建配置都通过上面提到的phing构建文件和.properties文件来处理.
将来,当我们有一个开发集成环境时,我们可能会在svn签入任何代码时进行自动部署.
此设置允许组织中的不同开发人员具有不同的技能组(主要是CSS/HTML与PHP),可以快速将代码更改到适当的环境,而不会涉及大量不必要的人员.Hudson允许我锁定不同的部署作业,因此只有合适的人才有权配置它们并启动它们.
这是对我所设置内容的高级概述,让我知道你的想法.这种设置最大的烦恼是密钥对,用户帐户和所有不同服务器上的rsync文件权限.
戴夫