eZ Community » Forums » Discussions » Automatic deployment - QA#6
expandshrink

Wednesday 21 August 2013 10:19:25 am - 3 replies

» Read full blog post

Introduction

After a break during the summer holiday months, I'm back with another musing around quality software development. This time I'll talk a little about how to set up automatic deployment. Automatic deployment is an essential part of quality development, and it's also one of the simplest starting points for improvement. There is of course a range of ways to do automatic deployment, the following will describe how I have solved it. I have used this only on eZ Publish 4.x, but most of it should work with some adjustments on 5.x also.

[QA5 - Code review considerations]

Wednesday 21 August 2013 3:33:04 pm

Thanks Arne for sharing, and continuing this captivating series of posts!

I particularly like the tips about template cache clearing happy.gif Emoticon

Keep going,

Tuesday 10 September 2013 8:30:26 am

Hi Arne!

In one of our multi-siteaccess project we're running your way of deploying things and it works like a charm with one exception: cache.

Unfortunately clearing cache in way you do it is not enough for templates other than full templates (i.e. templates being used by include command). So we came up with new idea:

There's routine in our project that we add {Jenkins} word followed by siteaccess name ( {Jenkins}my_siteaccess_name ) to commit which needs cache to be cleared. Than in Jenkins job configuration we added one build step:

cat ../builds/${BUILD_NUMBER}|>/changelog.xml | grep {Jenkins} | sed 's/.*\/\(.*\){Jenkins}/\1-\*/'> siteaccesses_to_clear.txt

Then in deploy script there is something like

siteaccess_list=`cat git/siteaccesses_to_clear.txt`
 
for i in $siteaccess_list; do
    if [[ ! $i = '' ]]; then
       echo Clearing cache for ${i:9}
      ssh login@server "cd ~/eZRoot; php bin/php/ezcache.php --clear-all -s ${i:9}"
   fi
done

Which clear cache for chosen siteaccess. This might be a little hacky, but works.

Wednesday 18 September 2013 9:15:06 am

Thanks for your input, Tomasz.

I realize that my template cache clearing doesn't handle all cases, but in my experience it has been shown to work well on most. I handle the cases that isn't working by manually logging in to the server and removing the template cache files that is related to changes I've made. It's not optimal, but eZ Publish legacy cache being as it is...

I guess your solution works well on big sites with many smallish siteaccesses. Then you can deploy changes to a single siteaccess and clear all cache without affecting all the other siteaccesses too much. If you have a site with only a single frontend siteaccess however, this is in effect the same as clearing all cache.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from