How do I use a VCS for my websites?

199 views Asked by At

We have a small company and we have developed our own CMS in PHP/MySQL. The code is stored in local files and in the database.

We'd like to be able to update the code of the CMS on our client's servers. This process should be semi-automatic, once we 'publish' the update, the code gets replaced on the client's server and in the database.

I was thinking about using Bazaar in combination with Bazaar Upload. This would take care of the files. But what about the database? Is there a standard method already available or should I upload a .sql file that gets installed when a user logs in to the CMS?

Thanks in advance for your suggestions!

2

There are 2 answers

1
Marek Sebera On BEST ANSWER

Use combination of SVN/SVN and Cron

use install package (.rpm,.sh,.deb, whatever) and setup cron job to run your update script

UML:

#!/bin/sh
fetch $version
if(version > current_version); do
    cd /path/on/client/server
    svn update
    /path/on/client/server/update_script.sh
done;

where update_script.sh will take care about whatever you need (sql,cron,files,certificates, ...)

Second variant

You can use something like fake cron job

In Administration you can create "Autoupdate" feature, which can be triggered by button/link or by timer. Timer is activated by running autoupdate script after login to CMS Administration

Simple check time from last update check and perform download of files, running .sql scripts or whatever you need.

0
AmanicA On

For this sort of thing I'm considering liquibase, but it needs java to run so you either need java on the server or maybe on the machine from where you are triggering the deployment.