我安装了PHP应用程序(Laravel)和eb CLI.在当地,一切都很好.
初始应用程序按预期工作(上载为archive.zip on created).
当我使用以下命令将我的仓库推送到我的应用程序
git aws.push
它失败.日志说:
[2014-12-12T16:53:38.652Z] INFO [28264] - [CMD-AppDeploy/AppDeployStage0/AppDeployPreHook/10_composer_install.sh] : Activity Failed. [2014-12-12T16:53:38.652Z] INFO [28264] - [CMD-AppDeploy/AppDeployStage0/AppDeployPreHook] : Activity Failed. [2014-12-12T16:53:38.652Z] INFO [28264] - [CMD-AppDeploy/AppDeployStage0] : Activity Failed. [2014-12-12T16:53:38.653Z] INFO [28264] - [CMD-AppDeploy] : Completed activity. Result: Command CMD-AppDeploy Failed.
还有这个
[2014-12-12T16:53:38.653Z] ERROR [28264] : Command CMD-AppDeploy Failed! [2014-12-12T16:53:38.654Z] INFO [28264] : Command processor returning results: {"status":"FAILURE","api_version":"1.0","truncated":"true","results": [{"status":"FAILURE","msg":"[CMD-AppDeploy/AppDeployStage0/AppDeployPreHook/10_composer_install.sh] command Failed with error code 1: /opt/elasticbeanstalk/hooks/appdeploy/pre/10_composer_install.sh\n++ /opt/elasticbeanstalk/bin/get-config container -k app_staging_dir\n+ EB_APP_STAGING_DIR=/var/app/ondeck\n+ cd /var/app/ondeck\n+ '[' -f composer.json ']'\n+ export COMPOSER_HOME=/root\n+ COMPOSER_HOME=/root\n+ '[' -d vendor ']'\n++ /opt/elasticbeanstalk/bin/get-config optionsettings -n aws:elasticbeanstalk:container:PHP:PHPini -o composer_options\n+ PHP_COMPOSER_OPTIONS=\n+ echo 'Found composer.json file. Attempting to install vendors.'\nFound composer.json file. Attempting to install vendors.\n+ composer.phar install --no-ansi --no-interaction\nLoading composer repositories with package information\nInstalling dependencies (including require-dev) from lock file\n - Installing symfony/finder (v2.5.8)\n ","returncode":1,"events":[]}]}
我当时认为这是一个Composer问题,我已经进入实例并在机器内完成了一个作曲家更新,但工作正常.
我已从.gitignore中删除了composer.lock文件
我在网上找不到任何类似的东西,所以我假设我正在做一些事情/缺少一些非常明显的东西.
我设法解决了我遇到的问题.我有一些失败的私人回购,因为我没有在bitbucket中设置部署密钥,因此无法下载它们.在配置文件中添加以下内容解决了这个问题.
原文链接:https://www.f2er.com/php/137694.htmlfiles: "/root/.ssh/bitbucket_deployment_key": mode: "000600" owner: root group: root content: | -----BEGIN RSA PRIVATE KEY----- PUT YOUR PRIVATE KEY HERE -----END RSA PRIVATE KEY----- "/root/.ssh/config": mode: "000600" owner: root group: root content: | Host bitbucket.org StrictHostKeyChecking no IdentityFile /root/.ssh/bitbucket_deployment_key UserKnownHostsFile /dev/null
从https://github.com/modern-media/wordpress-on-beanstalk起
我不确定这是否能解决问题.错误消息非常通用.我不得不深入研究完整的EB日志才能到达我的底部.
额外我还发现有时作曲家可能会失败,因为它在尝试下载回购时会得到404.这很奇怪,因为我总是将composer.lock文件保持可靠.这是一个简单的解决方案.只需删除.lock文件并再次运行composer update即可在.lock文件中获取正确的repo URL.