A companion application to Dockerhero for easy and quick local development.
What can it do? It is made to make multi-step workflows executable in just 1 single command. So, for example, 1 local command can take care of your composer installation and migrations within Dockerhero and asset building on your local machine.
- Clone this project to your project directory, the directory that also includes Dockerhero. For example:
/home/john/projects
composer install
cp .env.example .env
cp recipes.yml.example recipes.yml
From here you have 2 choices, you can either add the path to Hero CLI to your $PATH
or build yourself a binary and place it in, for example, /usr/local/bin
Put the following line in your ~/.bash_aliases
or ~/.bashrc
file:
export PATH="$PATH:$HOME/projects/hero-cli"
Please make sure that the path is actually correct.
- Change the
.env
file to reflect your local setup. - Change the
recipes.yml
file to reflect your project workflow.
The power of Hero CLI lies in the recipes. It allows you to define your workflow for you projects.
For an example of a recipe file, you can take a look at the recipes.yml.example
file in the root of the project.
Please note, docker commands should always be relative. Hero CLI takes care of building the path for you.
The following variables can be used:
{localProjectPath}
This will be replaced with the path to your project
To execute a recipe, you run:
hero recipe {recipeName} {projectName}
By default an exception will be thrown if an error occurs during a command's execution. To allow failures to happen, add
allow_failure: true
to the recipe's command.
By default the output of the commands will be hidden. To view the output, add
show_output: true
to the recipe's command.
By default the local command will be executed in the project directory. To customize the path, add
path: "/home/username/my-custom/path/"
to the recipe's command.
A command is included to automatically setup a project for the first time. Simply run:
hero setup:project {projectName}
The .env.example will be copied, and the database and the database user will automatically be setup.
If you discover any security-related issues, please email johan@johanvanhelden.com instead of using the issue tracker.
GNU General Public License v3.0 (gpl-3.0). Please see the License File for more information.