Today, we’re excited to open source something we have been working on internally for a couple of years: Dirt.
Dirt, which is a backronym for “Done In Record Time,” is a command-line deployment and bootstrapping tool for rapidly creating and launching new projects. It was born out of the need for automating and standardizing common tasks such as creating a git repository, setting up a Vagrantfile, or transferring MySQL dumps between development environments.
The following is an overview of some of Dirt’s features.
Create
Entering “dirt create” in the command line will create a new project, and you can optionally have Dirt configure it using a framework (such as Laravel, WordPress, and so forth). Dirt will create a folder locally for the project, create a git repository on GitHub or GitLab, generate database credentials and a custom Vagrantfile, download the newest version of the framework (if necessary) and configure it with the proper database credentials. Dirt will also do various other things such as setting up a README file based on the project and an existing template.
Getting started with the project is now as simple as booting up the virtual machine using “vagrant up.”
Deploy
Dirt is designed to be used with a 3-stage development environment: local, staging, and production. This command allows you to deploy your site to staging and production.
When deploying to staging, Dirt will merge all existing changes to a staging branch, configure the staging server with a custom virtual host file for the project and run any framework-specific commands (such as “composer install” for a Laravel project). Dirt will also set up and configure a MySQL user and database and give you the option to copy the database contents from development to staging.
Deploying to production is a much simpler process. Dirt will pack up the stable code from staging (excluding the .git folder) and transfer them to a production server via SFTP. You are responsible for configuring vhost, database and alike in the production environment.
Dirt is now available as open source software, so go ahead and check it out. We’re more than happy to accept pull requests and issue tickets.
For a more in-depth technical introduction to Dirt and instructions on how to set Dirt up for your own team, please consult the README file.