Topic: Add Your Kete Application's Code to Version Control

Topic type:

Optional, but recommended best practice for Kete applications. Create a version control repository and import the Kete software as the basis of your Kete application's codebase.

Originally written by Walter McGinnis, Kete Project Lead for Katipo Communications, Ltd.

Part of the Installation Guide


We currently use Git to manage importing the Kete codebase into specific projects' version control repositories.

This means it is easy to track Kete upgrades while allowing your own customisations.

First up, create a Git repository that is accessable via ssh. It's a good idea have your Git repository on a host separate from your development environment. On that host, do this:

$ mkdir /path/to/repos/your_app.git
$ cd /path/to/repos/your_app.git
$ git --bare init --shared=group

Then go to your development machine and do the following:

$ cd ~/apps
$ mv your_app your_app_bak # assuming you have this around from before
$ git clone git://github.com/kete/kete.git your_app
$ cd your_app
$ git remote rm origin
$ git remote add origin ssh://your_git_host/path_to_your_git_repo.git
$ git push origin master

Review the Kete Downloads page and decide whether you want to use the release branch or trunk for your application's codebase. Adjust the git clone command above to include the branch checkout if needed.

Take note, we assume that you want to use the same database names and database user on production as development and thus commit config/database.yml to version control since it will be the same in each environment.

$ cp ../your_app_bak/config/database.yml config # copy our previously configured database settings
$ cp config/backgroundrb.yml.example config/backgroundrb.yml
# now edit config/backgroundrb.yml to suit
$ cp ../your_app_backup/config/mongrel_cluster.yml config
$ cp ../your_app_bak/zebradb/keteaccess zebradb
$ cp ../your_app_bak/zebradb/conf/kete-zebra-servers.xml zebradb/conf
$ git add -f .
$ git commit -m "Imported Kete as the basis of my project"
$ git push origin master

Now you have a copy of Kete in a personal Git repository which you can add/edit and commit back to any time you like. And you can use this now to deploy with capistrano.

Discuss This Topic

There are 0 comments in this discussion.

join this discussion

Creative Commons Attribution-Share Alike 3.0 New Zealand License
Add Your Kete Application's Code to Version Control by Walter McGinnis is licensed under a Creative Commons Attribution-Share Alike 3.0 New Zealand License