Back to Deployer

Common Recipe

docs/recipe/common.md

8.0.36.2 KB
Original Source
<!-- DO NOT EDIT THIS FILE! --> <!-- Instead edit recipe/common.php --> <!-- Then run bin/docgen -->

Common Recipe

php
require 'recipe/common.php';

Source

Configuration

user

Source

Name of current user who is running deploy. If not set will try automatically get git user name, otherwise output of whoami command. :::info Autogenerated The value of this configuration is autogenerated on access. :::

keep_releases

Source

Number of releases to preserve in releases folder.

php
10

repository

Source

Repository to deploy.

default_timeout

Source

Default timeout for run() and runLocally() functions.

Set to null to disable timeout.

php
300

env

Source

Remote environment variables.

php
set('env', [
    'KEY' => 'something',
]);

It is possible to override it per run() call.

php
run('echo $KEY', env: ['KEY' => 'over']);

dotenv

Source

Path to .env file which will be used as environment variables for each command per run().

php
set('dotenv', '{{release_or_current_path}}/.env');
php
false

deploy_path

Source

The deploy path.

For example can be set for a bunch of host once as:

php
set('deploy_path', '~/{{alias}}');

:::info Required Throws exception if not set. :::

current_path

Source

Return current release path. Default to deploy_path/current.

php
set('current_path', '/var/public_html');
php
'{{deploy_path}}/current'

bin/php

Source

Path to the php bin.

php
if (currentHost()->hasOwn('php_version')) {
return '/usr/bin/php{{php_version}}';
}
return which('php');

bin/git

Source

Path to the git bin.

php
return which('git');

Source

Should bin/symlink use --relative option or not. Will detect automatically.

php
return commandSupportsOption('ln', '--relative');

Source

Path to the ln bin. With predefined options -nfs.

php
return get('use_relative_symlink') ? 'ln -nfs --relative' : 'ln -nfs';

sudo_askpass

Source

Path to a file which will store temp script with sudo password. Defaults to .dep/sudo_pass. This script is only temporary and will be deleted after sudo command executed. :::info Autogenerated The value of this configuration is autogenerated on access. :::

Tasks

deploy:prepare {#deploy-prepare}

Source

Prepares a new release.

This task is group task which contains next tasks:

deploy:publish {#deploy-publish}

Source

Publishes the release.

This task is group task which contains next tasks:

deploy {#deploy}

Source

Deploys your project.

This task is group task which contains next tasks:

deploy:success {#deploy-success}

Source

Deploys your project.

Prints success message

deploy:failed {#deploy-failed}

Source

Hook on deploy failure.

logs:app {#logs-app}

Source

Shows application logs.

Follows latest application logs.