PHP Deployer is a great little utility for deploying your PHP app via command line. It doesn’t force you to use any specific tech stack and simplifies the process of getting your app live.
This blog post assumes the following:
I have a Lumen app which I will be deploying with Deployer in this blog post, so there might be Lumen/Laravel specific commands and roles.
There are a couple of ways you can install deployer. To keep my code device & environment agnostic, I have opted for the composer method.
This means I don’t have to set up deployer on the machine if I wish to deploy my app, just SSH access and composer.
The composer version of deployer is run with php vendor/bin/dep
, however for the rest of this tutorial I will reference the global command dep
.
This may seem like an odd step to put here, but seeing the finished result will help you understand the configuration.
Once deployed (the example below has a couple of deployments), a PHP Deployer app has the following folder & file structure in the deploy_path
location:
(I hope that makes sense).
#php