Phrases like “deploying your code” are often thrown around without much explanation. Let’s fix that!
Software is born on a developer’s computer, joined in with other developer’s work, makes it’s way onto test servers, and finally, if everything goes well, ends up on the production server for the entire world to enjoy. These last two steps, going to the test and production server are at the heart of “deployment”.
At it simplest, deployment is taking code from somewhere and putting it somewhere else. Typically, this will be from your developer’s machine, or your shared repository, to the server. Because this process is automated, it’s common to setup additional steps to this process to improve quality. In a typical setup this would include:
Even if you can’t set things up to get all the benefits above, automating as much of your process as you can builds the foundation for the other steps.
My projects often have a bin/deploy
file which is a simple script file that pulls the latest code, updates the database, refreshes the caches, and reboots the server.
From a process documentation point of view, this is beautiful since I do not need to explain the deployment process to anyone, and if I ever do, it is right there in plain text. Once that works, its a fairly simple process to have the script kicked off by a system, which continues the trend towards automation. This is what lays the foundation of a resilient and stable system.