deployphp/deployer

View on GitHub
docs/recipe/deploy/rollback.md

Summary

Maintainability
Test Coverage
<!-- DO NOT EDIT THIS FILE! -->
<!-- Instead edit recipe/deploy/rollback.php -->
<!-- Then run bin/docgen -->

# Rollback Recipe

```php
require 'recipe/deploy/rollback.php';
```

[Source](/recipe/deploy/rollback.php)


## Configuration
### rollback_candidate
[Source](https://github.com/deployphp/deployer/blob/master/recipe/deploy/rollback.php#L19)

Rollback candidate will be automatically chosen by looking
at output of `ls` command and content of `.dep/releases_log`.

If rollback candidate is marked as **BAD_RELEASE**, it will be skipped.

:::tip
You can override rollback candidate via:
```
dep rollback -o rollback_candidate=123
```
:::
:::info Autogenerated
The value of this configuration is autogenerated on access.
:::





## Tasks

### rollback
[Source](https://github.com/deployphp/deployer/blob/master/recipe/deploy/rollback.php#L62)

Rollbacks to the previous release.

Uses [rollback_candidate](/docs/recipe/deploy/rollback.md#rollback_candidate) for symlinking. Current release will be marked as
bad by creating file **BAD_RELEASE** with timestamp and [user](/docs/recipe/common.md#user).

:::warning
You can always manually symlink [current_path](/docs/recipe/common.md#current_path) to proper release.
```
dep run '{{bin/symlink}} releases/123 {{current_path}}'
```
:::