在BlueMix上运行DreamFactory 2.0 [英] Running DreamFactory 2.0 on BlueMix
问题描述
我正在尝试在BlueMix上运行DreamFactory 2.0.我已按照 https://developer上的说明进行操作.ibm.com/bluemix/2014/06/17/getting-started-laravel-bluemix/关于在BlueMix上运行Laravel应用程序的信息.除了.bp-config,.cfignore,manifest.yml和composer.json外,我在htdocs下都有所有内容.我为composer.json中的所有脚本修改了artisan的路径,然后做了
I am trying to get DreamFactory 2.0 running on BlueMix. I have followed the instructions found at https://developer.ibm.com/bluemix/2014/06/17/getting-started-laravel-bluemix/ on running Laravel applications on BlueMix. I have everything under htdocs except for .bp-config, .cfignore, manifest.yml and composer.json. I have modified the path to artisan for all the scripts in composer.json and then did
cf push df2
在日志消息中,我看到正在安装php buildpack,所有模块,然后
In the log messages, I see the php buildpack getting installed, all the modules and then
/tmp/staged/app/php/bin/php /tmp/staged/app/php/bin/composer.phar install --no-progress --no-interaction --no-dev
安装依赖项就好了,然后我明白了
The dependencies get installed just fine, then I see
Writing lock file
Generating autoload files
[RuntimeException]
Could not scan for classes inside "database" which does not appear to be a file nor a folder
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]
-----> Composer command failed
Traceback (most recent call last):
File "/tmp/buildpacks/php-buildpack/scripts/compile.py", line 51, in <module>
.from_build_pack('lib/additional_commands')
File "/tmp/buildpacks/php-buildpack/lib/build_pack_utils/builder.py", line 189, in extensions
process_extension(path, ctx, 'compile', process, args=[self])
File "/tmp/buildpacks/php-buildpack/lib/build_pack_utils/utils.py", line 69, in process_extension
success(getattr(extn, to_call)(*args))
File "/tmp/buildpacks/php-buildpack/extensions/composer/extension.py", line 420, in compile
return composer.compile(install)
File "/tmp/buildpacks/php-buildpack/lib/extension_helpers.py", line 154, in compile
self._compile(install)
File "/tmp/buildpacks/php-buildpack/extensions/composer/extension.py", line 173, in _compile
self.run()
File "/tmp/buildpacks/php-buildpack/extensions/composer/extension.py", line 305, in run
*self._ctx['COMPOSER_INSTALL_OPTIONS'])
File "/tmp/buildpacks/php-buildpack/extensions/composer/extension.py", line 350, in run
shell=True)
File "/tmp/buildpacks/php-buildpack/lib/build_pack_utils/runner.py", line 109, in stream_output
raise CalledProcessError(retcode, cmd)
build_pack_utils.runner.CalledProcessError: Command '<open file '<fdopen>', mode 'w' at 0x7ffa34c4d810>' returned non-zero exit status 1
Staging failed: Buildpack compilation step failed
这是我的文件:
---
applications:
- name: df2
memory: 512M
buildpack: https://github.com/cloudfoundry/php-buildpack#v3.2.2
env:
CF_STAGING_TIMEOUT: 15
CF_STARTUP_TIMEOUT: 15
BP_DEBUG: "True"
services:
- df2-cleardb
.bp-config/options.json
{
"WEB_SERVER": "nginx",
"LIBDIR": ".",
"COMPOSER_VENDOR_DIR": "htdocs/vendor",
"WEBDIR": "htdocs/public",
"NGINX_VERSION": "{NGINX_16_LATEST}",
"PHP_VERSION": "{PHP_56_LATEST}",
"PHP_EXTENSIONS": [
"bz2",
"curl",
"fileinfo",
"ldap",
"mbstring",
"mcrypt",
"mongo",
"mysql",
"openssl",
"pdo",
"pdo_mysql",
"pdo_sqlite",
"pgsql",
"redis",
"sockets",
"zip",
"zlib"
]
}
composer.json
{
"name": "dreamfactory/dreamfactory",
"description": "The DreamFactory(tm) Platform.",
"keywords": [
"api",
"dreamfactory",
"dsp",
"rest"
],
"homepage": "https://www.dreamfactory.com/",
"license": "Apache-2.0",
"authors": [
{
"name": "Arif Islam",
"email": "arifislam@dreamfactory.com"
},
{
"name": "David Weiner",
"email": "davidweiner@dreamfactory.com"
},
{
"name": "Jerry Ablan",
"email": "jerryablan@dreamfactory.com"
},
{
"name": "Lee Hicks",
"email": "leehicks@dreamfactory.com"
}
],
"support": {
"email": "support@dreamfactory.com",
"source": "https://github.com/dreamfactorysoftware/dreamfactory",
"issues": "https://github.com/dreamfactorysoftware/dreamfactory/issues",
"wiki": "https://wiki.dreamfactory.com"
},
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"laravel/framework": "5.1.*",
"tymon/jwt-auth": "0.5.*",
"dreamfactory/df-managed": "dev-feature/bluemix_debug as dev-master",
"dreamfactory/df-admin-app": "2.0.*",
"dreamfactory/df-core": "0.1.*",
"dreamfactory/df-aws": "0.1.*",
"dreamfactory/df-rackspace": "0.1.*",
"dreamfactory/df-sqldb": "0.1.*",
"dreamfactory/df-mongodb": "0.1.*",
"dreamfactory/df-couchdb": "0.1.*",
"dreamfactory/df-rws": "0.1.*",
"dreamfactory/df-salesforce": "0.1.*",
"dreamfactory/df-soap": "0.1.*",
"dreamfactory/df-user": "0.1.*",
"dreamfactory/df-oauth": "0.1.*",
"dreamfactory/df-adldap": "0.1.*"
},
"require-dev": {
"barryvdh/laravel-ide-helper": "~2.0",
"laracasts/generators": "~1.0",
"laracasts/testdummy": "~2.0",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1",
"laravel/homestead": "dev-master"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"DreamFactory\\": "htdocs/app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"pre-install-cmd": [
"echo \"\npath is $PWD\nls is\n$(ls -al)\"",
"rm -rf htdocs/bootstrap/cache/*.php"
],
"post-install-cmd": [
"echo \"\npath is $PWD\nls is\n$(ls -al)\"",
"php htdocs/artisan clear-compiled",
"php htdocs/artisan optimize",
"php htdocs/artisan dreamfactory:pull-migrations --dst=htdocs/database/migrations",
"php htdocs/artisan dreamfactory:setup --force --bluemix"
],
"post-update-cmd": [
"php htdocs/artisan clear-compiled",
"php htdocs/artisan optimize",
"php htdocs/artisan dreamfactory:pull-migrations --dst=htdocs/database/migrations",
"php htdocs/artisan dreamfactory:homestead-config"
]
},
"config": {
"preferred-install": "source"
},
"extra": {
"branch-alias": {
"dev-develop": "2.0.x-dev"
},
"installer-paths": {
"public/{$name}/": [
"type:dreamfactory-app"
]
}
}
}
post-install-cmd和post-update-cmd中的dreamfactory:pull-migrations命令从供应商目录(我知道,我知道,不是我的设计)中收集所有迁移,并将它们放在htdocs/database中/migrations目录. dreamfactory:setup命令将创建.env文件,运行key:generate,migrate和db:seed
The dreamfactory:pull-migrations command in the post-install-cmd and post-update-cmd gather all the migrations from the vendor directory (I know, I know. Not my design) and puts them in the htdocs/database/migrations directory. The dreamfactory:setup command will create the .env file, runs key:generate, migrate and db:seed
基于错误消息,这听起来像是dreamfactory:pull-migrations没有运行或正在出错,但是由于该应用程序无法启动,所以我无法查看文件结构.
Based on the error message, it sounds like the dreamfactory:pull-migrations isn't getting run or is erroring out, but since the app doesn't start, I have no way of looking at the file structure.
有人对为什么它不起作用有任何想法吗?我们正在使用Laravel 5.1.
Does anybody have any ideas on why it isn't working? We're using Laravel 5.1.
谢谢!
推荐答案
已解决!
我错过了composer.json中一篇文章.我错过了更改
I missed one thing from the article in my composer.json. I missed changing
"classmap": [
"database"
],
到
"classmap": [
"htdocs/database"
],
这将解释为什么找不到数据库目录.之后,只需调整我的post-install-cmd命令即可.
which would explain why it couldn't find the database directory. After that, it was a simple matter of tweaking my post-install-cmd commands.
这篇关于在BlueMix上运行DreamFactory 2.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!