【发布时间】:2014-12-16 09:58:01
【问题描述】:
我正在使用 Heroku 以默认配置部署我的 Symfony2 应用程序,但资产没有转储。
我已经添加到 composer.json :
...
"scripts": {
"post-install-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
"php app/console --env=prod assetic:dump"
]
},
...
方法对吗?
在 Procfile 中,不起作用。还有:
heroku run php app/console --env=prod assetic:dump
也不行。
谢谢,
参考:https://devcenter.heroku.com/articles/getting-started-with-symfony2
【问题讨论】:
-
我认为您应该在部署之前转储您的资产。在 repo 中包含过时的文件是没有意义的,因此在提交 repo(部署)之前,您应该确保您的资产都已准备好。这是我的看法
-
对于协作工作,我必须发送源而不是编译文件。当后端开发者推送 repo 时,他不应该在发送之前转储资产本身。我认为编译应该是自动的,但是在哪里呢?这也是我的看法;)谢谢你的帖子!