Add default symfony_env

This commit is contained in:
Anton Medvedev 2021-04-17 15:41:07 +02:00
parent 24fc2fadad
commit c23688adcf
2 changed files with 9 additions and 0 deletions

View File

@ -11,6 +11,7 @@
* Require
* [`recipe/common.php`](/docs/recipe/common.md)
* Config
* [`symfony_env`](#symfony_env)
* [`symfony_version`](#symfony_version)
* [`shared_dirs`](#shared_dirs)
* [`shared_files`](#shared_files)
@ -25,6 +26,11 @@
* [`deploy`](#deploy) — Deploy project
## Config
### symfony_env
[Source](https://github.com/deployphp/deployer/search?q=%22symfony_env%22+in%3Afile+language%3Aphp+path%3Arecipe+filename%3Asymfony.php)
This env config will be used for `bin/console dump-env` command.
### symfony_version
[Source](https://github.com/deployphp/deployer/search?q=%22symfony_version%22+in%3Afile+language%3Aphp+path%3Arecipe+filename%3Asymfony.php)

View File

@ -5,6 +5,9 @@ require_once __DIR__ . '/common.php';
add('recipes', ['symfony']);
// This env config will be used for `bin/console dump-env` command.
set('symfony_env', 'prod');
set('symfony_version', function () {
$result = run('{{bin/console}} --version');
preg_match_all('/(\d+\.?)+/', $result, $matches);