duanjiu1894 2015-04-08 10:35
浏览 42
已采纳

Laravel Forge部署环境变量问题

My App will not deploy because it is missing required environment variables.

When I set these from within Forge, they appear. As soon as I hit deploy they all disappear, then my deploy fails.

I am using Symfony2 with Digital Ocean - but shouldn't make a difference, the issue is all environment variables get deleted prior to a deploy. That can't be right?

Here is the error message from Symfony, but it is due to the environment variable not being set (in forge I can see it get deleted right before a deploy)

 - Installing tedivm/stash-bundle (v0.4.2)
Loading from cache

 - Installing twig/extensions (v1.2.0)
Loading from cache

Generating autoload files
Creating the "app/config/parameters.yml" file
PHP Fatal error:  Class 'Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle' not found in /home/forge/beta.dashboardhub.io/app/AppKernel.php on line 31
PHP Stack trace:
PHP   1. {main}() /home/forge/beta.dashboardhub.io/app/console:0
PHP   2. Symfony\Component\Console\Application->run() /home/forge/beta.dashboardhub.io/app/console:27
PHP   3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /home/forge/beta.dashboardhub.io/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:126
PHP   4. Symfony\Component\HttpKernel\Kernel->boot() /home/forge/beta.dashboardhub.io/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:70
PHP   5. Symfony\Component\HttpKernel\Kernel->initializeBundles() /home/forge/beta.dashboardhub.io/app/bootstrap.php.cache:2343
PHP   6. AppKernel->registerBundles() /home/forge/beta.dashboardhub.io/app/bootstrap.php.cache:2513

Fatal error: Class 'Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle' not found in /home/forge/beta.dashboardhub.io/app/AppKernel.php on line 31

Call Stack:
    0.0002     225112   1. {main}() /home/forge/beta.dashboardhub.io/app/console:0
    0.0253    3126784   2. Symfony\Component\Console\Application->run() /home/forge/beta.dashboardhub.io/app/console:27
    0.0279    3329440   3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /home/forge/beta.dashboardhub.io/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:126
    0.0279    3329664   4. Symfony\Component\HttpKernel\Kernel->boot() /home/forge/beta.dashboardhub.io/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:70
    0.0279    3329960   5. Symfony\Component\HttpKernel\Kernel->initializeBundles() /home/forge/beta.dashboardhub.io/app/bootstrap.php.cache:2343
    0.0279    3330560   6. AppKernel->registerBundles() /home/forge/beta.dashboardhub.io/app/bootstrap.php.cache:2513

Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception



  [RuntimeException]                                                         
  An error occurred when executing the "'cache:clear --no-warmup'" command.  



install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [packages1] ... [packagesN]
  • 写回答

1条回答 默认 最新

  • drx3157 2015-04-08 16:08
    关注

    This is an issue / feature of Forge. It does reset the environment variables before a deploy.

    Here is the response from their support...

    Yeah that has been a point of confusion I will fix today. Basically the original thought was if you are installing a new project you will want new environment variables, but many people set the environment variables before installing.

    Taylor Otwell

    So it looks like it will be fixed soon.

    I have not been able to find a Forge Ticket, Twitter Account or Deployment changelog to follow this progress.


    Temporary Solution / Work around

    No there is not currently a deployment change log. I will let you know when it is ready to go. It’s a little trickier than it sounds… for now, you could install the project and just un-check the “Install Composer” step, then add your environment variables, then click the “Deploy” button so it picks up the composer install step.

    Taylor Otwell

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥70 刚刚看到一个人的网站居然是通过cname访问的
  • ¥15 Attributeerror:super object has no attribute '__sklearn_tags__'_'
  • ¥15 逆置单链表输出不完整
  • ¥15 宇视vms-B200-A16@R启动不了,如下图所示,在软件工具搜不到,如何解决?(操作系统-linux)
  • ¥500 寻找一名电子工程师完成pcb主板设计(拒绝AI生成式答案)
  • ¥15 关于#mysql#的问题:UNION ALL(相关搜索:sql语句)
  • ¥15 matlab二位可视化能否针对不同数值范围分开分级?
  • ¥15 已经创建了模拟器但是不能用来运行app 怎么办😭自己搞两天了
  • ¥15 关于#极限编程#的问题,请各位专家解答!
  • ¥20 win11账户锁定时间设为0无法登录