I maintain a bunch of Drupal sites for friends and family, but due to the nature of these, they often have sporadic development. An issue I've been facing recently is that of security/module maintenance. This post describes how I automated and simplififed the process of updating many drupal sites using docker and automated deployment using the Wercker service.
I've already espounded the advantages of docker in other posts, but I'd thought it might be useful to share (and document for my own benefit), how I've been running my own personal drupal projects using docker. There are already some great pre-built drupal images out there on the docker registry, but partly because none quite fitted my workflow, and partly to better understand how it works, I setup my own. This post details the docker-compose config I use for my drupal projects.
Setting up an effective development environment using docker requires a change of thinking when coming from regular VM tools such as Vagrant. This post discusses some of the concepts around separating services to separate containers, and why you would want to do this.
Docker is a great technology, but in a previous post I mentioned the issues boot2docker has on Mac OS X, specifically with volume mounts.
Since a significant proportional of our development team (including myself) develop on Mac OS X, these issues affect us on a daily basis, so I did some digging to find out the causes of this slowdown and what (if anything) can be done to fix it.
To summarise the problem:
A technology I've been evaluating and testing lately is Docker. It uses Linux container (LXC) technology to provide essentially a native speed linux virtual machine which can be configured via script files (Dockerfiles) and provides a public registry of built-images. The concept is similar to using a virtual machine configured via text files such as vagrant or something similar, except the big bonus is speed, since the native LXC container technology allows direct hardware access on Linux.
We've been making use of the angular-gettext module to provide translation functionality on angular sites recently. It works quite nicely, giving a simple
<translate> directive which can be used in templates to indicate strings for translation.
- Big projects using grunt can end up with long and hard to read gruntfiles
- When working on multiple similar projects, grunt task config and alias tasks are often repeated
- How do we package these files to make them self-contained with dependencies and versioning?
- There's a bunch of contrib options with pros/cons, but in the end I went with a basic self-written grunt plugin using
Here's an annoying bug I ran into today, which curiously seems only to apply to IE8 and not IE7.
If you declare a selector block in a stylesheet with a pseudo-class that IE8 does not recognise, mixed with one that it does, IE8 won't recognise either of them. Here's an example
When needing to set up scheduled task in custom drupal modules, it is common to handle these with a hook_cron function. When this hook is triggered, it usually runs as the drupal anonymous user, but in some situations you want to run code during cron which requires certain higher level privileges.