简体   繁体   English

将SVN用于具有自定义内容的共享代码库

[英]Using SVN for shared codebase with custom content

I have a website that I need to deploy to about 30 customers. 我有一个网站,需要将其部署到大约30个客户。 They are all the same apart from the branding. 除了品牌之外,它们都是一样的。 Using SVN, I would like to have one base version of the product, and then just the different branded content (images, CSS) for each customer. 使用SVN,我想拥有一个基本版本的产品,然后为每个客户提供不同的品牌内容(图像,CSS)。 That way, when I maintain the base product, I don't have to replicate that change for each customer. 这样,当我维护基本产品时,我不必为每个客户复制该更改。 Deployment would just be a case of updating and releasing. 部署只是更新和发布的一种情况。

Sounds simple, but I am having problems achieving this in SVN. 听起来很简单,但是我在SVN中实现这一点时遇到了问题。 I have been looking into SVN externals using a structure as follows: 我一直在使用以下结构研究SVN外部结构:

  • Main 主要
    • Base 基础
      • .
      • .
      • Images 图片
  • Customer 1 客户1

    • Base 基础
    • Custom 自订
      • Images 图片
  • Customer 2 客户2

    • Base 基础
    • Custom 自订
      • Images 图片

and then using externals pointing the Customer Base folders to the main base folder. 然后使用外部将“客户基础”文件夹指向主基础文件夹。 That works, but I then need to overwrite (for example) the images in the Customer 1\\Base\\Images folder with the customer specific ones, and when I set up the externals for that it complains “Customer 1\\Base\\Images is not a working copy root”. 那行得通,但随后我需要用客户特定的图像覆盖(例如)Customer 1 \\ Base \\ Images文件夹中的图像,并且当我设置外部对象时,它抱怨“ Customer 1 \\ Base \\ Images not工作副本根目录”。 It does appear to have overwritten the image with the customer one though. 它似乎确实已与客户之一覆盖了该图像。

Maybe externals are not the answer. 也许外部因素不是答案。

In your case, the interface is clearly separeted from the functionality. 在您的情况下,界面与功能显然是分开的。 A possibility is the following (if I well understood your problem) : 以下是一种可能(如果我很了解您的问题):

Manage your application in a dedicated SVN repository (as usual, with your trunk, branches and tags). 在专用的SVN存储库中管理您的应用程序(通常,使用主干,分支和标签)。 And manage your design versions in another repository, with for example the following structure : 并在另一个存储库中管理您的设计版本,例如,具有以下结构:

./Customer_1
./Customer_1/trunk
./Customer_1/tags
./Customer_1/branches
./Customer_2
./Customer_2/trunk
./Customer_2/tags
./Customer_2/branches
...

With this separation, it's easy to you to manage the version number of your main application. 通过这种分离,您可以轻松管理主应用程序的版本号。 And you have a "small" repository for each customer with possibility to easily copy a design version to start another one by svn copy . 而且,每个客户都有一个“小型”存储库,可以通过svn copy轻松复制一个设计版本以启动另一个svn copy

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

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