简体   繁体   English

Drupal和版本控制

[英]Drupal and versioning

I looked for similar questions to mine and one seemed promising, but the accepted anser was not applicable to me (I think.) 我向我寻找类似的问题,其中一个似乎很有希望,但是接受的anser不适用于我(我想。)

Drupal Source Control Strategy? Drupal源控制策略?

Basically one has to have rights on the server you are deploying to. 基本上,必须拥有要部署到的服务器的权限。 That is not my situation. 那不是我的情况。 I use a hosting service and I do not think I can install SVN on it. 我使用托管服务,我认为我不能在其上安装SVN。

So, do i just develop on a "dummy" site and somehow do a lots of juggling by testing ont eh dummy site, getting the content (Including the database) and putting that in SVN and then releasing it to my live site? 所以,我只是在一个“虚拟”网站上开发,并通过测试虚拟网站,获取内容(包括数据库)并将其放入SVN,然后将其发布到我的实际网站,以某种方式做了很多杂耍?

What does the Drupal database look like? Drupal数据库是什么样的? My dummy and live sites wo not/will not have the same admin/user logins, etc. 我的虚拟和现场网站不会/不会有相同的管理员/用户登录等。

What are others doing for developing in Drupal and managing revisions? 还有其他人在Drupal开发和管理修订方面做了什么?

Quite a few hosting services -- even cheap shared hosts -- have the SVN or CVS client installed. 相当多的托管服务 - 甚至廉价的共享主机 - 安装了SVN或CVS客户端。 That's different than SVN hosting , a service that some hosting companies do explicitly offer. 这与SVN 托管不同,SVN 托管是一些托管公司明确提供的服务。 It's worth checking; 这值得检查; having a source control client will make your life a lot easier no matter what. 拥有源控制客户端无论如何都会让您的生活变得更轻松。

Our launch workflow tends to go something like: 我们的启动工作流程倾向于:

  • Set up the codebase 设置代码库
  • Put it into SVN/git/whatever Develop, code, create content, configure, etc 把它放到SVN / git /无论是开发,编码,创建内容,配置等等
  • Make DB snapshots at regular intervals to preserve sanity 定期制作数据库快照以保持理智
  • Delete any dummy content or dummy user accounts that were created during development 删除在开发期间创建的任何虚拟内容或虚拟用户帐户
  • Push code to a production or test box 将代码推送到生产或测试框
    • If you have a source control client on your host, use it to deploy the codebase. 如果主机上有源控制客户端,请使用它来部署代码库。
    • If you don't, make an explicit branch or tagged version of your codebase using whatever mechanism your source control system of choice offers. 如果不这样做,请使用您选择的源控制系统提供的任何机制制作代码库的显式分支或标记版本。
    • Don't change code on the live server. 不要更改实时服务器上的代码。 Always use source control update, or upload a full copy of the "blessed" branch/tag. 始终使用源代码管理更新,或上传“祝福”分支/标记的完整副本。 Getting the live site's code out of sync with itself is hell. 让现场网站的代码与自身不同步是很糟糕的。
  • If you need to push a new snapshot up and online, either have a separate /db directory out of the webroot that is also under source control, or just use SFT and upload the DB snapshots on an adhoc basis. 如果您需要在线创建新快照,或者在webroot中有一个单独的/ db目录,该目录也受源代码控制,或者只是使用SFT并在特定的基础上上传数据库快照。 You don't want to keep them in a web-accessible directory obviously, as people downloaing your raw DB snapshots is double-plus-ungood. 显然,您不希望将它们保存在可通过Web访问的目录中,因为下载原始数据库快照的人员是双重加密的。

I did a presentation on deployment stuff a month or so ago and posted the slides online; 我在大约一个月前就部署内容进行了演示,并在线发布了幻灯片; it might be useful. 它可能有用。 slideshare link slidehare链接

There are two aspects of versioning with Drupal. 使用Drupal进行版本控制有两个方面。

1/ Structure 1 /结构

GIT is my weapon of choice, it's largely adopted in the Drupal community, outside too actually, and extremely flexible. GIT是我的首选武器,它主要在Drupal社区中采用,实际上也非常灵活。

With Drupal , you then need a couple of essential tools. 使用Drupal,您需要一些基本工具。

  • Features , a module which will help you put to code some of your sites structure that usually reside in the database. 功能 ,一个模块,可以帮助您编写通常驻留在数据库中的一些站点结构。 Views, Content Types, Taxonomies Vocabularies, even Taxonomies Terms, if you use the UUID & UUID Features modules, etc... 视图,内容类型,分类法词汇表,甚至分类法术语,如果您使用UUID和UUID功能模块等...

  • Drush not only will help you with creating & updating your features but it's an essential tool to have when building Drupal sites. Drush不仅可以帮助您创建和更新您的功能,而且它是构建Drupal站点时必不可少的工具。 Unless you're allergic to the command line, managing Features with Drush is far more flexible & robust than using Features' UI. 除非您对命令行过敏,否则使用Drush管理功能比使用功能UI更灵活,更强大。

2/ Content 2 /内容

That's one is even simpler , provided you don't have a large amount of content, you can use the Backup & Migrate module. 这个更简单,只要您没有大量内容,就可以使用备份和迁移模块。

Some Drupal friendly hosting services will provide you with GIT preinstalled, if you really can't have access to a server, GIT still remains an excellent development tool. 一些Drupal友好的托管服务将为您提供预安装的GIT,如果您真的无法访问服务器,GIT仍然是一个很好的开发工具。

Sorry, I haven't provided any links, it's bit late here but these tools are very easy to find, I'm sure you'll have no problems whatsoever! 对不起,我没有提供任何链接,这里有点迟,但这些工具很容易找到,我相信你没有任何问题!

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

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