Stay updated with all the latest happenings at Techjoomla. From news about the developments in your favourite extensions to Tips & Tricks about the Joomla CMS, Framework & Development.
Over the years we've been using various methods to deploy websites to servers. FTP is everyone's first love and hot favourite. But when GIT came along and we started using that our VCS of choice it became increasingly evident that we can use it for deployment too. The biggest challenge here was managing the database. Because of the way new table creations and table alterations are handled in Joomla we decided to leave out table updates in the automated deployment process and chose to handle them by extension installation or manual creation. With that decided it became easy to structure and write code so that it can be deployed via a simple script.
I'm giving here an example of the deployment script for a website that relies heavily on Zoo. We also have a few other extensions but Zoo is central. A few points about our setup
Here's the structure of the project's git repo
/code /code/www (Contains Joomla and all extensions -- this is what gets deployed) /code/scripts (This is where the deployment and other scripts are stored) /database (Contains schema dump for new devs to start with) /documentation (Release notes)
Here's what the dev team follows
Now, to perform the deployment the person doing the deloyment has to login to the server and simply run the deployment script.
$ cd /var/www && ./joomla-deploy.sh 0.8.4 0.8.3 alpha
You can download the script from here - Joomla Deploy Script
Here's what the script does in a nutshell
The dev team is very happy with the script since deployment time has reduced to a few seconds and is pretty much error free. Also, in case of any major isses with the deployed version, its very easy to roll back to the older version by simply changing the symlink to point to the older version!