The majority of our projects at Francis Bond are heavily content-driven, requiring a content management systems. In the past, we drifted from platform to platform, searching for the holy grail of balanced functionality, simplicity, and client-friendliness. Eventually, we found that with Craft—see our write-up on why Craft will make your life better.
Craft's simple and developer-centric templating system gave us a considerable boost in productivity, but we could do better. Standardizing the platform on which we base the majority of our projects presented an opportunity to lock down and automate our workflow.
Our existing workflow generally—although this varied project-to-project—looked something like this:
Aside from this lackluster process for setting up development and staging environments, we had few development workflows in place. Most projects had little-to-no build automation, synchronizing databases between development and staging environments was manual, and setting up development environments on everyone's machines was tedious.
We soon discovered our current workflow was unworkable. Not only were we wasting time with tedious manual tasks, but were creating a major scalability issue; taking on more projects and more developers meant more manual work, more room for errors, and more inconsistency.
We also knew what we wanted our workflow to be. Our wish-list consisted of the following:
We chose Vagrant to standardize our local development environments. Vagrant is a tool for creating and configure lightweight, reproducible, and portable development environments. A machine is defined in a Vagrantfile and creating with a single command: vagrant up.
Vagrant supports automated provisioning, allowing us to install and configure Apache, PHP, and MySQL, all as part of running vagrant up. Vagrant's shared folders creates a bridge between the virtual machine and the local filesystem, meaning any changes made locally are instantly available to the machine.
For running build tasks, we initially selected Grunt, but soon switched to Gulp, favoring its simple code-over-configuration methodology. There are several tasks we wished to automate:
Now that we had our development environments completely automated, we created a Yeoman generator to scaffold out new projects quickly and easily. Our Yeoman generator spits out a copy of our Vagrantfile and Gulpfile, a fresh installation of Craft, and installs a few Bower components that we use ubiquitously.
After trialling several systems for automating deployments to staging environments, we stumbled upon Dokku. You can think of Dokku as a self-hosted Heroku; you provide a repository and a few lines of configuration, and with a git push, Dokku provisions hosting environment inside a Docker image, and deploys the app for you.
After wrapping Dokku's commands in Gulp tasks, and creating a few tasks to push, pull, and backup databases, deployments couldn't be easier.
After iterating our workflow for the past year, testing, adapting and improving it with each project, we've achieved:
If you're in the position to lock-down and automate your development workflow, I highly recommend you do so; careful decisions, and a few days work has lead us to save several hours on every project. With minimal effort, our workflow, along with build scripts, and generators, could be adapted to work with almost any CMS platform.
Fork our Craft Generator on GitHub and start hacking, or take a look at the following resources to get started:
Posted by Angus Fretwell
Mon, 02 Feb 2015
Job: Are you a Laravel Developer? Come do rad stuff...
Join a fun team of passionate nerds who build fun stuff.
The tools we use: JIRA
JIRA is a fantastic tool for managing complex software projects, as it works like an online version of a project management whiteboard, and...
Designing the perfect user experience (UX)
UX design is where art meets function – and it is crucial to the health of your brand and the success of your business. Here we explore the...
Or call us on 0400 946 644