简体   繁体   English

开发工作流程,Joomla,GIT

[英]Development workflow, Joomla, GIT

I have some questions about how you set up your development environment. 我对如何设置开发环境有一些疑问。

I'm running a website that's currently using SOBI2. 我正在运行一个目前正在使用SOBI2的网站。 SOBI2 is going to be replaced by a custom component I'm creating using Nooku Framework. SOBI2将被我使用Nooku Framework创建的自定义组件所取代。

What I have so far is a Joomla install on my localhost. 到目前为止,我在本地主机上安装了Joomla。 Nooku Framework and my custom component is in their own directories on my computer and then symlinked to the Joomla installation. Nooku Framework和我的自定义组件在我们计算机上的自己的目录中,然后符号链接到Joomla安装。 I do this because it's nice to have them separated when developing. 我这样做是因为在开发时将它们分开是很好的。 My custom component is then tracked using GIT and Nooku is tracked in their public SVN repo. 然后使用GIT跟踪我的自定义组件,并在其公共SVN仓库中跟踪Nooku。 I guess this is a pretty standard setup. 我想这是一个非常标准的设置。

So, now I want to clone my LIVE Joomla installation to my localhost and track it using GIT to be able to push changes easily to my live server. 所以,现在我想将我的LIVE Joomla安装克隆到我的localhost并使用GIT跟踪它,以便能够轻松地将更改推送到我的实时服务器。 Right now the live site is not version controlled at all. 现在,实时网站根本不受版本控制。

So, how do I do this easily? 那么,我该如何轻松地做到这一点?

I guess it's best to use two GIT repos, one containing only my custom component and one for the entire site. 我想最好使用两个GIT repos,一个只包含我的自定义组件,一个包含整个站点。 The workflow would then be something like this when developing my custom component and site: 在开发我的自定义组件和站点时,工作流将是这样的:

  1. Make changes to custom component and test in empty Joomla install 更改自定义组件并在空Joomla安装中进行测试
  2. Commit changes. 提交更改。
  3. Pull in changes from my custom component repo to my local site (mirror of the live site through GIT). 将更改从我的自定义组件仓库引入我的本地站点(通过GIT实时站点的镜像)。
  4. Make sure everything is working. 确保一切正常。
  5. Commit and push changes to the sites GIT repo. 提交并推送对站点GIT仓库的更改。
  6. Pull in changes from the sites repo to the live server. 将站点repo中的更改引入实时服务器。

Database updates has to be handled manually I guess. 我猜想必须手动处理数据库更新。

  • Is this a good way of working? 这是一种很好的工作方式吗?
  • How do I track the custom component inside my local site? 如何跟踪本地站点内的自定义组件? I've heard about GIT Submodules, is this what it's used for? 我听说过GIT Submodules,它用于什么?

  • Any good guides out there for this kind of stuff? 这种东西有什么好的指南吗?

Best Regards Linus 最好的问候莱纳斯

We do it in the following way, but using the Mercurial source code management tool : 我们通过以下方式完成,但使用Mercurial源代码管理工具

  • Checkout empty repository from the bitbucket(or create local) 从bitbucket签出空存储库(或创建本地)
  • Install Joomla! 安装Joomla! into that folder 进入该文件夹
  • Add to .hgignore all the core joomla files and components and make sure they will not be committed 将.hgignore添加到所有核心joomla文件和组件中,并确保它们不会被提交
  • Add to the repository only the components, plugins, modules that we develop 仅将我们开发的组件,插件和模块添加到存储库

So basically we have Joomla inside our repository folder, but all its files are ignored, and do not get committed — except for the files of our own components. 所以基本上我们在我们的存储库文件夹中有Joomla,但是它的所有文件都被忽略了,并且没有被提交 - 除了我们自己组件的文件。

Then we check out the repository to the production server, and then install Joomla! 然后我们将存储库检出生产服务器,然后安装Joomla! there. 那里。 (First checkout, and then only install Joomla). (首先结账,然后只安装Joomla)。 When we check out the repo to production or any other place, only our files are checked out. 当我们检查生产或任何其他地方的回购时,只检查我们的文件。

For database changes usually we have a db folder (or whatever the name is), and we just add the SQL files with the scripts that make changes to the database. 对于数据库更改,通常我们有一个db文件夹(或任何名称),我们只需添加SQL文件以及对数据库进行更改的脚本。 You can easily call them with a command like mysql -uUser -pPass dbname < 12.table_name.change_name.sql 您可以使用mysql -uUser -pPass dbname < 12.table_name.change_name.sql类的命令轻松调用它们。

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

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