Topic: Updating to the latest Kete code

Topic type:

How to grab the latest code and update your project if you are using the "Optional Best Practices" production deployment.

Outdated. New upgrade guide available at Upgrading to Kete 1.1 Release or Upgrading to Kete 1.2 Release depending on what the version you are upgrading from is.



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

An appendix to the Installation Guide

This assumes that you having been using the setup outlined in "Optional Bestpractices - Managing your Kete application's codebase and deploying it to a production host".

This also assumes that you are on your development machine (unless noted). It's recommended that you run through the upgrade on a development Kete installation of your project, check that it works, then run through your deployment to production. You will need to repeat some steps on your production deployment. They will be noted.

Update your codebase to use the latest Kete or Kete 1.0 Stable Release Branch

We currently use Piston to manage importing the Kete codebase into specific projects' version control repositories (though we are seriously considering Git, if want to take it upon yourself to show us how, please create a related topic about how to do so).

Piston is a program that wraps up specific functionality of Subversion called Vendor Branch Management which that handles cleanly importing third party vendors' code, in this case the Kete software's code, into a project so that you can customize it to suit your needs.

First, you need to apply a patch to Piston to make it handle version control "adds and deletes" a bit better. The patch can be found at http://rubyforge.org/tracker/index.php?func=detail&aid=16698&group_id=2105&atid=8179.

On Mac OS X 10.5.x the file you will need to patch is found at /Library/Ruby/Gems/1.8/gems/piston-1.3.3/lib/piston/command.rb, in Debian Etch it is /var/lib/gems/1.8/gems/piston-1.3.3/lib/piston/command.rb.

Important Note: Even with the patch, if your project is running a quite old version of Kete, the following command may abort with failures caused by missing files or directories. Usually rerunning the command until if finishes successfully will work.

Move into a subversion checkout of your project's code where you include the full directory structure, including the "trunk" directory, etc. Then run a piston update.

$ cd ~/apps/your_app # this should contain a trunk directory...
$ piston update # you may have to run this command several times, can be VERY SLOW
...

After you get through to a successful piston update, commit your update of the latest Kete code to your project's version control.

$ svn commit -m "importing the latest Kete code into the project"
...

Update your Kete application deployment

From here on out, you will need to do these steps first for development, then on your production host after a Capistrano deployment. Make note of the steps for production...

For a production deployment, first do this from your development environment to update your code base:

$ cd trunk # should be in apps/your_app/trunk on development host
$ cap deploy:update # maybe prompted for passwords...
...

Now that we have the Kete code we need, there are some additional steps that Kete will need to be set up right.

Note: the steps below are in your RAILS_ROOT of your application. If you have followed the steps above and in the Installation Guide, this is something like apps/your_app/trunk of development and apps/your_app/current for a Capistrano deployment on your production host.

Do this step for both your development Kete application and on your production host from their respective RAILS_ROOT directories.

Important Note: if you have done the step below before, you can safely skip down to the Backgroundrb step.

For development:

$ rake kete:upgrade:add_missing_mime_types

For production:

$ rake kete:upgrade:add_missing_mime_types RAILS_ENV=production

Now, you need to do some additional steps for the Backgroundrb Ruby on Rails plugin.

On production:

$ cd ~/apps/your_app
$ cp -r current/config/backgroundrb.yml shared/config/
$ cd current
$ script/backgroundrb stop
$ script/backgroundrb start

On development:

$ cd ~/apps/your_app/trunk
$ script/backgroundrb stop
$ script/backgroundrb start

Now restart your site's Kete server as outlined in this topic for production, or do a "cap deploy:stop" and then "cap deploy:start" from your development machine to restart your production site.

Discuss This Topic

There are 0 comments in this discussion.

join this discussion

Creative Commons Attribution-Share Alike 3.0 New Zealand License
Updating to the latest Kete code by Walter McGinnis is licensed under a Creative Commons Attribution-Share Alike 3.0 New Zealand License