Introduction
Recipes allow you to save common Bash scripts and run them across any of your servers. For example, you could save a recipe to install MongoDB so you can conveniently run it on future servers.Managing recipes
Creating recipes
To create a recipe, navigate to the “Recipes” page. Then, click the “New recipe” button. After providing a name, user and script, click the “Create recipe” button. When your organization is using teams, you will also be able to choose who to share the recipe with. By default, this is everyone in your organization, but you may also share recipes with teams.Editing recipes
To edit a recipe, navigate to the “Recipes” page. Then, click on the dropdown next to the recipe you want to edit. Click the “Edit” dropdown item and modify the recipe as required.Deleting recipes
To delete a recipe, navigate to the “Recipes” page. Then, click on the dropdown next to the recipe you want to delete. Click the “Delete” dropdown item and confirm that you do want to delete the recipe.Running recipes
To run a recipe, navigate to the “Recipes” page. Then, click on the dropdown next to the recipe you want to run. Click the “Run” dropdown item and select the servers you want to run the recipe on. You may also choose to send the recipe output via email. Recipes will also create run logs which you can access by clicking on the recipe item. From here you may click on a run to see the full output.Variables
Laravel Forge provides a few variables that can be used to make your recipe more dynamic. You are free to use any of these variables within your recipe’s script:{{server_id}}
- The ID of the server that the recipe is running on{{server_name}}
- The name of the server that the recipe is running on{{ip_address}}
- The public IP address of the server{{private_ip_address}}
- The private IP address of the server{{username}}
- The server user who is running the script{{db_password}}
- The database password for the server the script is running on{{server_type}}
- The type of the server that the recipe is running on, i.e. one of the following…"app"
"cache"
"database"
"loadbalancer"
"meilisearch"
"web"
"worker"