无需开发要求即可在AWS上安装Composer [英] Composer install on AWS without development requirements

查看:107
本文介绍了无需开发要求即可在AWS上安装Composer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以覆盖AWS Elastic BeanStalk默认的composer安装命令吗?

Is there some way how to override AWS Elastic BeanStalk default composer install command?

我想运行composer install --no-dev.

推荐答案

是的,您可以在AWS Beanstalk中将额外的标志附加到composer命令.

Yes, you can append extra flags to the composer command in AWS Beanstalk.

您需要在<app-root-dir>/.ebextensions/composer.config中创建一个额外的配置文件:

You need to create an extra config file in <app-root-dir>/.ebextensions/composer.config:

commands:
  10updateComposer:
    command: export COMPOSER_HOME=/root && /usr/bin/composer.phar self-update
option_settings:
  aws:elasticbeanstalk:application:environment:
    option_name: COMPOSER_HOME
    value: /root
  aws:elasticbeanstalk:container:php:phpini:
    composer_options: --no-dev

composer_options中输入的任何内容都将附加到作曲家命令行中.

Whatever you put in composer_options will be appended to the composer command line.

您可以通过查看您的/var/log/eb-activity.log文件来验证此操作是否正确执行.注意以下内容:

You can verify this is executed correctly by looking at your /var/log/eb-activity.log file. Look out for something like this:

 ++ /opt/elasticbeanstalk/bin/get-config optionsettings -n aws:elasticbeanstalk:container:php:phpini -o composer_options
  + PHP_COMPOSER_OPTIONS=--no-dev
  + echo 'Found composer.json file. Attempting to install vendors.'
  Found composer.json file. Attempting to install vendors.
  + composer.phar install --no-ansi --no-interaction --no-dev

有关更多信息,您可以阅读部分.

For more info you can read the Composer File section in the manual.

这篇关于无需开发要求即可在AWS上安装Composer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆