Development workflow, Joomla, GIT
Asked Answered
C

1

6

I have some questions about how you set up your development environment.

I'm running a website that's currently using SOBI2. SOBI2 is going to be replaced by a custom component I'm creating using Nooku Framework.

What I have so far is a Joomla install on my localhost. Nooku Framework and my custom component is in their own directories on my computer and then symlinked to the Joomla installation. 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. 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. 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. 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
  2. Commit changes.
  3. Pull in changes from my custom component repo to my local site (mirror of the live site through GIT).
  4. Make sure everything is working.
  5. Commit and push changes to the sites GIT repo.
  6. Pull in changes from the sites repo to the live server.

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?

  • Any good guides out there for this kind of stuff?

Best Regards Linus

Calvinna answered 27/6, 2011 at 18:41 Comment(1)
That is indeed what a Git submodule is used for. I think Git will even set it up automatically if you create a repo in a directory which contains contains a pre-existing repo lower in the directory tree.Jujitsu
G
3

We do it in the following way, but using the Mercurial source code management tool:

  • Checkout empty repository from the bitbucket(or create local)
  • Install Joomla! into that folder
  • Add to .hgignore all the core joomla files and components and make sure they will not be committed
  • 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.

Then we check out the repository to the production server, and then install Joomla! there. (First checkout, and then only install 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. You can easily call them with a command like mysql -uUser -pPass dbname < 12.table_name.change_name.sql

Grounds answered 30/6, 2011 at 8:20 Comment(1)
This approach has disadvantage: developing site with few custom components. You cannot update those components via git.Haugh

© 2022 - 2024 — McMap. All rights reserved.