简体   繁体   English

如何在git中管理drupal网站

[英]How to manage a drupal website in git

I'm a bit lost, one of my developer co-worker is doing a drupal website, that is doing special pages, custom logos, custom hierarchy etc. His work is scattered in database tables (it looks like CCK create tables), database rows (texts, image links etc.), static files (pictures, PDFs ...) and maybe some PHP (custom module). 我有点迷茫,我的一个开发人员同事正在做一个drupal网站,即做特殊页面,自定义徽标,自定义层次结构等。他的工作分散在数据库表中(看起来像CCK创建表),数据库行(文本,图像链接等),静态文件(图片,PDF ......)和一些PHP(自定义模块)。

My problem is to get his work in the git repository and being able to deploy it on various servers in a consistent way, like I would do with traditional developer work (let's say J2EE). 我的问题是让他的工作在git存储库中,并能够以一致的方式在各种服务器上部署它,就像我对传统的开发人员工作一样(比如说J2EE)。 One of my constraint is avoiding raw SQL because we might deploy the same code on various RDBMS. 我的一个约束是避免原始SQL,因为我们可能在各种RDBMS上部署相同的代码。 But if I have to, I'll relax this constraint. 但如果必须,我会放松这个约束。

I can't find a module that does that out of the box, do you have any pointer I could have missed on the drupal website ? 我找不到一个开箱即用的模块,你有什么指针我可以在drupal网站上错过吗?

Thanks for your help, 谢谢你的帮助,

Nicolas. 尼古拉斯。

The Features module might get you were you want to go. 功能模块可能会让你想要去。 It allows you to export various site and module configurations. 它允许您导出各种站点和模块配置。 The exports are in the form of a custom Drupal module which you could then store and manage via git, and subsequently roll the features out to other Drupal sites. 导出是自定义Drupal模块的形式,然后您可以通过git存储和管理,然后将功能滚动到其他Drupal站点。

http://drupal.org/project/features http://drupal.org/project/features

more info (and a screencast) on the module: 模块上的更多信息(和截屏视频):
http://developmentseed.org/blog/2009/may/29/making-and-using-features-drupal http://developmentseed.org/blog/2009/may/29/making-and-using-features-drupal

Using Features along with Context is very powerful. 使用功能Context非常强大。 Context lets you create a "section" for your site. 上下文允许您为站点创建“部分”。 It's best illustrated through an example: 最好通过一个例子来说明:

Lets say we define the "Forum" context as anything with the url of forums/*. 让我们说我们将“论坛”上下文定义为论坛/ *的url。 Context lets us say: "I want to show these three views in the right side bar, only when I am in the "Forums" context. 上下文让我们说:“我想在右侧栏中显示这三个视图,只有当我在”论坛“上下文时。

Now, using Features, we can create "module" define by the context. 现在,使用Features,我们可以创建由上下文定义的“模块”。 So, we will end up with a module called "youSite_forums", which will include all the views, blocks, etc. that was define in your Forums context. 因此,我们最终会得到一个名为“youSite_forums”的模块,该模块将包含您在论坛上下文中定义的所有视图,块等。 It also will determine the correct dependencies, as well as Content Types used in the context. 它还将确定正确的依赖关系,以及上下文中使用的内容类型。 All will be bundled up nicely in a module. 所有这些都将很好地捆绑在一个模块中。


As for versioning content such as node, you can user either Node Export, or just do a DB dump using Backup and Migrate. 对于节点等版本控制内容,您既可以使用节点导出,也可以使用“备份和迁移”进行数据库转储。 We use these occasionally, but we never have every node versioned in SVN. 我们偶尔使用这些,但我们从未在SVN中对每个节点进行版本控制。


Links: 链接:

Features 特征

Context 上下文

Backup and Migrate 备份和迁移

You might also want to look into services & deployment. 您可能还想查看服务和部署。 Deployment uses services xmlrpc server to to transmit most drupal data from one site to another, or in your case, your devs installation to a staging installation. 部署使用服务xmlrpc服务器将大多数drupal数据从一个站点传输到另一个站点,或者在您的情况下,将您的devs安装传输到分段安装。

http://drupal.org/project/Services http://drupal.org/project/Services

http://drupal.org/project/deploy http://drupal.org/project/deploy

As for a method to "deploy it on various servers in a consistent way" look into Capistrano with railsless-deploy. 至于“以一致的方式在各种服务器上部署它”的方法,请使用无轨道部署查看Capistrano。 It's so simple to setup some tasks, I use it to deploy all my drupal sites. 设置一些任务非常简单,我用它来部署我所有的drupal站点。

http://www.capify.org/index.php/Capistrano http://www.capify.org/index.php/Capistrano

http://github.com/leehambley/railsless-deploy http://github.com/leehambley/railsless-deploy

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM