Technical information on this site may be out of date : no updates since 2015

mini scripts to obtain git id/branch/tag

February 5, 2013 , posted under git

$new_branch=$1 # passed as param

current_branch="$(git symbolic-ref HEAD 2>/dev/null)"
current_branch=${current_branch##refs/heads/}

current_id=$(git rev-parse --short origin/$current_branch)

new_id=$(git rev-parse --short origin/$new_branch)

last_tag=$(git describe --abbrev=0 --tags)

Read More…

Git submodules and subtrees

November 26, 2012 , posted under git

Git has the concept of both submodules and subtrees, there seem to be some problems with each solution, nether being well loved as far as I can see.

Both add significant complexity to a project, and require extra care - but the alternative is monolithic projects or a lot of copy-pasting.

Submodules allow another git repo to be nested inside the main one, you can then commit to either repo from the same filesystem.

Read More…

Varnish on two ports, with separate backends

November 22, 2012 , posted under varnish

We have a site with a hardware ssl accelerator wich routes http traffic to port 80 and decrypted https traffic (so back to http) to port 443. We wanted varnish to cache the 443 traffic, and I came up with this proof of concept config, in reality you’d want to have a bunch of different rules for your https site to ensure you cache only what you want to.

in /etc/varnish/default.vcl

Read More…

Satellite vs Puppet

November 20, 2012 , posted under puppet satellite spacewalk configuration management devops

I’ve been using Puppet for a little while and am now working on a project that will be using RedHat’s Satellite (the upstream project is Spacewalk).

I haven’t really used puppet in anger on production systems yet, I’m referring to the open source edition of Puppet, and have only read about Satellite, but I didn’t find much comparison out there so thought it worth writing up what I’ve found.

They key differences that strike me are

Read More…

Jenkins Build script for Drupal - multistep with changelogs

September 28, 2012 , posted under drupal jenkins ci

My build script has been getting more complex lately and I’m quite pleased with it.

We tend to have several versions of code on the go, version x is live, x+1 is in UAT, and x+2 is in development. With all these versions around it’s important to keep track of changelogs, and to upgrade correctly x to x+1, and then x+1 to x+2 as we have found that going direct from x to x+2 can fail to uncover some bugs. Specifically this happens if a drupal update hook gets edited after it has been released to the client, but before it has run on live. Our builds always start from a copy of the live site.

Read More…

Monitor filesystem for deletions

September 28, 2012 , posted under drupal linux inotify-tools

On a project I’m working on at the moment we have a problem, files are going missing.

We don’t know which part of the system could be trashing these files (user uploaded images in this case) and they are on a shared filesystem so there are plenty of places to point fingers.

Read More…