mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-24 01:02:24 +01:00
250 lines
5.7 KiB
Markdown
250 lines
5.7 KiB
Markdown
|
<!-- DO NOT EDIT THIS FILE! -->
|
||
|
<!-- Instead edit recipe/common.php -->
|
||
|
<!-- Then run bin/docgen -->
|
||
|
|
||
|
# common
|
||
|
|
||
|
[Source](/recipe/common.php)
|
||
|
|
||
|
|
||
|
|
||
|
* Requires
|
||
|
* [provision](/docs/recipe/provision/provision.md)
|
||
|
* [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
|
||
|
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L30)
|
||
|
|
||
|
Name of current user who is running deploy.
|
||
|
If not set will try automatically get git user name,
|
||
|
otherwise output of `whoami` command.
|
||
|
|
||
|
|
||
|
|
||
|
### keep_releases
|
||
|
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L47)
|
||
|
|
||
|
Number of releases to preserve in releases folder.
|
||
|
|
||
|
```php title="Default value"
|
||
|
10
|
||
|
```
|
||
|
|
||
|
|
||
|
### repository
|
||
|
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L50)
|
||
|
|
||
|
Repository to deploy.
|
||
|
|
||
|
|
||
|
|
||
|
### shared_dirs
|
||
|
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L57)
|
||
|
|
||
|
List of dirs what will be shared between releases.
|
||
|
Each release will have symlink to those dirs stored in {{deploy_path}}/shared dir.
|
||
|
```php
|
||
|
set('shared_dirs', ['storage']);
|
||
|
```
|
||
|
|
||
|
|
||
|
|
||
|
### shared_files
|
||
|
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L64)
|
||
|
|
||
|
List of files what will be shared between releases.
|
||
|
Each release will have symlink to those files stored in {{deploy_path}}/shared dir.
|
||
|
```php
|
||
|
set('shared_files', ['.env']);
|
||
|
```
|
||
|
|
||
|
|
||
|
|
||
|
### copy_dirs
|
||
|
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L68)
|
||
|
|
||
|
List of dirs to copy between releases.
|
||
|
For example you can copy `node_modules` to speedup npm install.
|
||
|
|
||
|
|
||
|
|
||
|
### clear_paths
|
||
|
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L71)
|
||
|
|
||
|
List of paths to remove from [release_path](/docs/recipe/deploy/release.md#release_path).
|
||
|
|
||
|
|
||
|
|
||
|
### clear_use_sudo
|
||
|
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L74)
|
||
|
|
||
|
Use sudo for deploy:clear_path task?
|
||
|
|
||
|
```php title="Default value"
|
||
|
false
|
||
|
```
|
||
|
|
||
|
|
||
|
### use_relative_symlink
|
||
|
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L76)
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
### use_atomic_symlink
|
||
|
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L79)
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
### default_timeout
|
||
|
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L86)
|
||
|
|
||
|
Default timeout for `run()` and `runLocally()` functions.
|
||
|
|
||
|
Set to `null` to disable timeout.
|
||
|
|
||
|
```php title="Default value"
|
||
|
300
|
||
|
```
|
||
|
|
||
|
|
||
|
### env
|
||
|
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L102)
|
||
|
|
||
|
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](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L111)
|
||
|
|
||
|
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
|
||
|
```
|
||
|
|
||
|
|
||
|
### current_path
|
||
|
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L119)
|
||
|
|
||
|
Return current release path. Default to {{deploy_path}}/`current`.
|
||
|
```php
|
||
|
set('current_path', '/var/public_html');
|
||
|
```
|
||
|
|
||
|
```php title="Default value"
|
||
|
'{{deploy_path}}/current'
|
||
|
```
|
||
|
|
||
|
|
||
|
### sudo_askpass
|
||
|
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L139)
|
||
|
|
||
|
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
|
||
|
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L152)
|
||
|
|
||
|
The deploy target: a branch, a tag or a revision.
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
## Tasks
|
||
|
|
||
|
### deploy:prepare
|
||
|
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L170)
|
||
|
|
||
|
.
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
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
|
||
|
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L180)
|
||
|
|
||
|
.
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
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
|
||
|
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L190)
|
||
|
|
||
|
.
|
||
|
|
||
|
Prints success message
|
||
|
|
||
|
|
||
|
### deploy:failed
|
||
|
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L200)
|
||
|
|
||
|
.
|
||
|
|
||
|
Hook on deploy failure.
|
||
|
|
||
|
|
||
|
### logs
|
||
|
[Source](https://github.com/deployphp/deployer/blob/master/recipe/common.php#L209)
|
||
|
|
||
|
Follow latest application logs.
|
||
|
|
||
|
Follow latest application logs.
|
||
|
|
||
|
|