Skip to content

Latest commit

 

History

History
57 lines (39 loc) · 2.88 KB

overview-strategy-choose.md

File metadata and controls

57 lines (39 loc) · 2.88 KB

Choose the right strategy

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.

Set up a default 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',

Give a particular host its own strategy

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',
    ],  
]

Choose your strategy when running the command

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

Overview of available strategies

Strategy Description Quick schema
basic (doc) Simple deployment process that takes place inside the host intself Overview basic schema
firstdeploy (doc) Simple deployment process optimised for first deployments on already live hosts. Overview firstdeploy schema
local (doc) Builds your release locally and upload it to your server when it's ready. Overview local schema
pull (doc) Simply runs git pull in your current folder, therefore does not provide zero-downtime. Overview pull schema
upload (doc) Uploads a production-ready folder directly within a new release. Overview upload schema

Learn how to create your own strategy here.

🔥 Pro tips:

  • Run php artisan deploy:dump strategy:basic (replace basic 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.