deployer/docs/recipe/symfony.md

166 lines
3.6 KiB
Markdown
Raw Normal View History

2021-09-26 15:25:58 +02:00
<!-- DO NOT EDIT THIS FILE! -->
<!-- Instead edit recipe/symfony.php -->
<!-- Then run bin/docgen -->
2022-07-26 00:12:23 +02:00
# How to Deploy Symfony
2021-09-26 15:25:58 +02:00
[Source](/recipe/symfony.php)
2022-07-26 00:12:23 +02:00
## How to deploy a Symfony project with zero downtime?
2022-07-26 00:19:14 +02:00
- First, [install](/docs/installation.md) the Deployer.
- Second, require `recipe/symfony.php` recipe into your _deploy.php_ or _deploy.yaml_ file.
- Third, now you can have a zero downtime deployment!
2022-07-26 00:12:23 +02:00
Did you know that you can deploy **Symfony** project with a single command? Just execute `dep deploy`.
2022-07-26 00:19:14 +02:00
Something went wrong? Just run `dep rollback` to rollback your changes.
2022-07-26 00:12:23 +02:00
Also, you can take an advantage of the [Deployer's CLI](/docs/cli.md) to deploy your project.
2022-07-26 00:19:14 +02:00
Another cool feature of the Deployer is [provisioning](/docs/recipe/provision.md). Take any server, and run `dep provision` command.
2022-07-26 00:12:23 +02:00
This command will configure webserver, databases, php, https, and more.
You will get everything you need to run your **Symfony** project.
2022-07-26 09:18:44 +02:00
Deployer does next steps to [deploy](#deploy) **Symfony**:
* Displays info about deployment
* Prepares host for deploy
* Locks deploy
* Prepares release
* Updates code
* Creates symlinks for shared files and dirs
* Makes writable dirs
* Installs vendors
* Clears cache
* Creates symlink to release
* Unlocks deploy
* Cleanup old releases
2022-07-26 00:19:14 +02:00
The symfony recipe is based on the [common](/docs/recipe/common.md) recipe.
2021-09-26 15:25:58 +02:00
## Configuration
### symfony_version
[Source](https://github.com/deployphp/deployer/blob/master/recipe/symfony.php#L8)
### shared_dirs
[Source](https://github.com/deployphp/deployer/blob/master/recipe/symfony.php#L14)
2021-10-18 18:29:14 +02:00
Overrides [shared_dirs](/docs/recipe/deploy/shared.md#shared_dirs) from `recipe/deploy/shared.php`.
2021-09-26 15:25:58 +02:00
```php title="Default value"
[
'var/log',
]
```
### shared_files
[Source](https://github.com/deployphp/deployer/blob/master/recipe/symfony.php#L18)
2021-09-26 15:25:58 +02:00
2021-10-18 18:29:14 +02:00
Overrides [shared_files](/docs/recipe/deploy/shared.md#shared_files) from `recipe/deploy/shared.php`.
2021-09-26 15:25:58 +02:00
```php title="Default value"
[
'.env.local'
]
```
### writable_dirs
[Source](https://github.com/deployphp/deployer/blob/master/recipe/symfony.php#L22)
2021-09-26 15:25:58 +02:00
Overrides [writable_dirs](/docs/recipe/deploy/writable.md#writable_dirs) from `recipe/deploy/writable.php`.
```php title="Default value"
[
'var',
'var/cache',
'var/log',
'var/sessions',
2021-09-26 15:25:58 +02:00
]
```
### migrations_config
[Source](https://github.com/deployphp/deployer/blob/master/recipe/symfony.php#L29)
2021-09-26 15:25:58 +02:00
### doctrine_schema_validate_config
[Source](https://github.com/deployphp/deployer/blob/master/recipe/symfony.php#L31)
2021-10-18 18:29:14 +02:00
### bin/console
[Source](https://github.com/deployphp/deployer/blob/master/recipe/symfony.php#L33)
2021-10-18 18:29:14 +02:00
```php title="Default value"
'{{bin/php}} {{release_or_current_path}}/bin/console'
```
2021-09-26 15:25:58 +02:00
### console_options
[Source](https://github.com/deployphp/deployer/blob/master/recipe/symfony.php#L35)
2021-09-26 15:25:58 +02:00
## Tasks
### database:migrate
[Source](https://github.com/deployphp/deployer/blob/master/recipe/symfony.php#L40)
2021-09-26 15:25:58 +02:00
2021-11-08 22:59:39 +01:00
Migrates database.
2021-09-26 15:25:58 +02:00
### doctrine:schema:validate
[Source](https://github.com/deployphp/deployer/blob/master/recipe/symfony.php#L50)
Validate the Doctrine mapping files.
2021-09-26 15:25:58 +02:00
### deploy:cache:clear
[Source](https://github.com/deployphp/deployer/blob/master/recipe/symfony.php#L55)
2021-09-26 15:25:58 +02:00
2021-11-08 22:59:39 +01:00
Clears cache.
2021-09-26 15:25:58 +02:00
### deploy
[Source](https://github.com/deployphp/deployer/blob/master/recipe/symfony.php#L64)
2021-09-26 15:25:58 +02:00
2021-11-08 22:59:39 +01:00
Deploys project.
2021-09-26 15:25:58 +02:00
This task is group task which contains next tasks:
* [deploy:prepare](/docs/recipe/common.md#deployprepare)
* [deploy:vendors](/docs/recipe/deploy/vendors.md#deployvendors)
* [deploy:cache:clear](/docs/recipe/symfony.md#deploycacheclear)
* [deploy:publish](/docs/recipe/common.md#deploypublish)