deployer/docs/recipe/common.md

238 lines
5.4 KiB
Markdown
Raw Normal View History

2021-09-26 15:25:58 +02:00
<!-- DO NOT EDIT THIS FILE! -->
<!-- Instead edit recipe/common.php -->
<!-- Then run bin/docgen -->
# common
[Source](/recipe/common.php)
* Requires
2021-10-09 15:59:42 +00:00
* [provision](/docs/recipe/provision.md)
2021-09-26 15:25:58 +02:00
* [check_remote](/docs/recipe/deploy/check_remote.md)
* [cleanup](/docs/recipe/deploy/cleanup.md)
* [clear_paths](/docs/recipe/deploy/clear_paths.md)
* [copy_dirs](/docs/recipe/deploy/copy_dirs.md)
* [info](/docs/recipe/deploy/info.md)
* [lock](/docs/recipe/deploy/lock.md)
* [push](/docs/recipe/deploy/push.md)
* [release](/docs/recipe/deploy/release.md)
* [rollback](/docs/recipe/deploy/rollback.md)
* [setup](/docs/recipe/deploy/setup.md)
* [shared](/docs/recipe/deploy/shared.md)
* [symlink](/docs/recipe/deploy/symlink.md)
* [update_code](/docs/recipe/deploy/update_code.md)
* [vendors](/docs/recipe/deploy/vendors.md)
* [writable](/docs/recipe/deploy/writable.md)
## Configuration
### user
2021-10-18 18:29:14 +02:00
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L31)
2021-09-26 15:25:58 +02:00
Name of current user who is running deploy.
If not set will try automatically get git user name,
otherwise output of `whoami` command.
2021-10-18 18:13:56 +02:00
### remote_user
2021-10-18 18:29:14 +02:00
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L49)
2021-10-18 18:13:56 +02:00
Name of remote user used for SSH connection.
Usually overridden per host. Otherwise, output of `whoami` will be used.
2021-09-26 15:25:58 +02:00
### keep_releases
2021-10-18 18:29:14 +02:00
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L54)
2021-09-26 15:25:58 +02:00
Number of releases to preserve in releases folder.
```php title="Default value"
10
```
### repository
2021-10-18 18:29:14 +02:00
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L57)
2021-09-26 15:25:58 +02:00
Repository to deploy.
### default_timeout
2021-10-18 18:29:14 +02:00
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L62)
2021-09-26 15:25:58 +02:00
Default timeout for `run()` and `runLocally()` functions.
Set to `null` to disable timeout.
```php title="Default value"
300
```
### env
2021-10-18 18:29:14 +02:00
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L78)
2021-09-26 15:25:58 +02:00
Remote environment variables.
```php
set('env', [
'KEY' => 'something',
]);
```
It is possible to override it per `run()` call.
```php
run('echo $KEY', env: ['KEY' => 'over']);
2021-09-26 15:25:58 +02:00
```
### dotenv
2021-10-18 18:29:14 +02:00
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L87)
2021-09-26 15:25:58 +02:00
Path to `.env` file which will be used as environment variables for each command per `run()`.
```php
set('dotenv', '{{current_path}}/.env');
```
```php title="Default value"
false
```
2021-10-18 18:29:14 +02:00
### deploy_path
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L97)
The deploy path.
For example can be set for a bunch of host once as:
```php
set('deploy_path', '~/{{alias}}');
```
2021-09-26 15:25:58 +02:00
### current_path
2021-10-18 18:29:14 +02:00
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L107)
2021-09-26 15:25:58 +02:00
2021-10-18 18:29:14 +02:00
Return current release path. Default to [deploy_path](/docs/recipe/common.md#deploy_path)/`current`.
2021-09-26 15:25:58 +02:00
```php
set('current_path', '/var/public_html');
```
```php title="Default value"
'{{deploy_path}}/current'
```
2021-10-18 18:29:14 +02:00
### bin/php
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L110)
Path to the `php` bin.
### bin/git
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L118)
Path to the `git` bin.
### use_relative_symlink
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L124)
Should [bin/symlink](/docs/recipe/common.md#bin/symlink) use `--relative` option or not. Will detect
automatically.
### bin/symlink
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L129)
Path to the `ln` bin. With predefined options `-nfs`.
2021-09-26 15:25:58 +02:00
### sudo_askpass
2021-10-18 18:29:14 +02:00
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L136)
2021-09-26 15:25:58 +02:00
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.
### target
2021-10-18 18:29:14 +02:00
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L149)
2021-09-26 15:25:58 +02:00
The deploy target: a branch, a tag or a revision.
## Tasks
### deploy:prepare
2021-10-18 18:29:14 +02:00
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L168)
2021-09-26 15:43:51 +02:00
2021-10-11 22:06:22 +02:00
Prepare a new release.
2021-09-26 15:25:58 +02:00
This task is group task which contains next tasks:
* [deploy:info](/docs/recipe/deploy/info.md#deployinfo)
* [deploy:setup](/docs/recipe/deploy/setup.md#deploysetup)
* [deploy:lock](/docs/recipe/deploy/lock.md#deploylock)
* [deploy:release](/docs/recipe/deploy/release.md#deployrelease)
* [deploy:update_code](/docs/recipe/deploy/update_code.md#deployupdate_code)
* [deploy:shared](/docs/recipe/deploy/shared.md#deployshared)
* [deploy:writable](/docs/recipe/deploy/writable.md#deploywritable)
### deploy:publish
2021-10-18 18:29:14 +02:00
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L179)
2021-09-26 15:43:51 +02:00
2021-10-11 22:06:22 +02:00
Publish the release.
2021-09-26 15:25:58 +02:00
This task is group task which contains next tasks:
* [deploy:symlink](/docs/recipe/deploy/symlink.md#deploysymlink)
* [deploy:unlock](/docs/recipe/deploy/lock.md#deployunlock)
* [deploy:cleanup](/docs/recipe/deploy/cleanup.md#deploycleanup)
* [deploy:success](/docs/recipe/common.md#deploysuccess)
### deploy:success
2021-10-18 18:29:14 +02:00
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L189)
2021-09-26 15:25:58 +02:00
2021-09-26 15:43:51 +02:00
2021-09-26 15:25:58 +02:00
Prints success message
### deploy:failed
2021-10-18 18:29:14 +02:00
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L199)
2021-09-26 15:25:58 +02:00
2021-09-26 15:43:51 +02:00
2021-09-26 15:25:58 +02:00
Hook on deploy failure.
2021-10-11 22:06:22 +02:00
### logs:app
2021-10-18 18:29:14 +02:00
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L208)
2021-09-26 15:25:58 +02:00
2021-10-11 22:06:22 +02:00
Show application logs.
2021-09-26 15:25:58 +02:00
Follow latest application logs.