Strategies are collections of tasks that defines a certain way to deploy your application. This page gives you an overview of all available strategies after explaining how to choose a default strategy and how to give a particular host its own strategy.
Simply set up your default
configuration to the strategy of your choice. See the overview below to help you choose the right strategy.
// config/deploy.php
'default' => 'basic',
In the example below, dev.domain.com
and staging.domain.com
will be using the basic
strategy whereas the production host domain.com
will be using the local
strategy.
// config/deploy.php
'default' => 'basic',
'hosts' => [
'dev.domain.com' => [],
'staging.domain.com' => [],
'domain.com' => [
'strategy' => 'local',
],
]
You can override your default strategy when running php artisan deploy
by providing the --strategy
or -s
option.
# This enables you to run a quick git pull update without editing your configurations.
php artisan deploy -s pull
Strategy | Description | Quick schema |
---|---|---|
basic (doc) | Simple deployment process that takes place inside the host intself | |
firstdeploy (doc) | Simple deployment process optimised for first deployments on already live hosts. | |
local (doc) | Builds your release locally and upload it to your server when it's ready. | |
pull (doc) | Simply runs git pull in your current folder, therefore does not provide zero-downtime. |
|
upload (doc) | Uploads a production-ready folder directly within a new release. |
Learn how to create your own strategy here.
🔥 Pro tips:
- Run
php artisan deploy:dump strategy:basic
(replacebasic
with the strategy you use) to display the tree of tasks that are executed during deployment including the ones added via hooks. - Note that this command can do that for any given task
php artisan deploy:dump mycustom:task
.