Comments (13)
Does anyone has an example how to using this bundle with Symfony 4?
from easy-deploy-bundle.
Hi,
i had the same error:
Generating autoload files
Executing script cache:clear [KO]
[KO]
Script cache:clear returned with error code 255
!! PHP Fatal error: Uncaught Symfony\Component\Dotenv\Exception\PathException: Unable to read the "/var/www/domain/releases/20190126225728/.env" environment file. in /var/www/domain/releases/20190126225728/vendor
/symfony/dotenv/Dotenv.php:466
!! Stack trace:
The main problem is: https://symfony.com/doc/current/configuration/dot-env-changes.html
B) The .env file is now commited to your repository. It was previously ignored via the .gitignore file (the updated recipe does not ignore this file). Because this file is committed, it should contain non-sensitive, default values. Basically, the .env.dist file was moved to .env.
FIX: #86
bin/console deploy staging
Initializing configuration
Starting the deployment
Updating app code
Preparing app
Optimizing app
Publishing app
Finishing the deployment
[OK] Deployment was successful
from easy-deploy-bundle.
I ran into the same issue. Since #86 has not been merged yet I solved it by adding a command to the beforePreparing()
hook as such:
public function beforePreparing()
{
$this->runRemote(sprintf('cp {{ deploy_dir }}/repo/.env {{ project_dir }} 2>/dev/null'));
}
from easy-deploy-bundle.
@cve Have you found the solution to this problem? I have the same problem with Symfony 4.
from easy-deploy-bundle.
@MSDATDE not yet
from easy-deploy-bundle.
this one hast it cleaner:
Wunderdata@35a3a31
from easy-deploy-bundle.
It is not bundle problem. You can move symfony/dotenv from dev deps in composer.json, or just set env vars properly.
http://symfony.com/doc/current/best_practices/configuration.html
from easy-deploy-bundle.
yep but you still have pass app_env manually to the "composer install"-call, otherwise the call will fail with
"symfony-cmd handling the auto-scripts event returned with error code 127"
from easy-deploy-bundle.
You can set it (and other vars like APP_DEBUG) in ~/.profile
or ~/.bashrc
for user which doing deploy for example export APP_ENV=prod
Or just
set -a
. /path/to/project/.env
set +a
https://unix.stackexchange.com/questions/79064/how-to-export-variables-from-a-file
from easy-deploy-bundle.
from easy-deploy-bundle.
AbstractDeployer actually sets variable SYMFONY_ENV to provided ->symfonyEnvironment(), which is later used in commands:
[[email protected]] Executing command: (export SYMFONY_ENV=staging; cd /usr/local/www/...
but this environment variable has no meaning in Symfony4 - code should set APP_ENV instead when run on version 4.
from easy-deploy-bundle.
I also have problems with Symfony 4 and .env file
Unable to read the "[...]/releases/20180208192107/bin/../.env" environment file.
from easy-deploy-bundle.
@PtrTn I have made the same but still having an error afer composer install:
[KO]
Script cache:clear returned with error code 1
!!
!! In EnvVarProcessor.php line 162:
!!
!! Environment variable not found: "APP_SERVER".
If I interrupt the deployment just at this step and run the same command manually, it works.
I have added the ENV var in .bashrc, so they are defined:
[21:51:04] root@vps:/var/www-deploy/site.com/releases/20191129214947# printenv | grep -i app
APP_SECRET=whatever
APP_DEBUG=0
APP_ENV=prod
APP_SERVER=prod
from easy-deploy-bundle.
Related Issues (20)
- User Deprecated: Passing a command as string when creating a "Symfony\Component\Process\Process" instance is deprecated
- {{ project_dir }} resolves to the local project directory in runLocal() HOT 3
- It would be cool if EasyDeploy pulled from git in a way which respected export-ignore in .gitattributes
- Symfony 5 compatibility HOT 8
- bash: where: command not found HOT 1
- deploy_dir per server HOT 2
- Error 123 with bin/console deploy test HOT 1
- bash: where: command not found HOT 1
- Configuration file path HOT 1
- updateRemoteComposerBinary requires sudo HOT 4
- Possible to run composer/php inside docker on prod?
- Running composer install --no-dev --optimize-autoloader before deploying failed HOT 1
- How to handle uploads files ? HOT 1
- Is this bundle still maintained HOT 1
- Problem with symlinks in chrooted ssh environment
- Add option for cloning/updating with submodules
- Mixed messages re: {{ deploy_dir }} HOT 1
- ABANDONED? HOT 3
- Permission denied (publickey) HOT 1
- Script @auto-scripts was called via post-install-cmd HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from easy-deploy-bundle.