doudian6229 2016-12-14 10:41
浏览 164
已采纳

如何告诉magallanes使用--no-dev执行composer?

I'm trying to deploy a PHP web application using Magallanes.

This is my actual task config:

tasks:
  pre-deploy:
    - composer/install
  on-deploy:
    - filesystem/link-shared-files:
        linked_folders:
          - web/fileadmin
          - web/uploads
          - web/typo3temp
          - web/typo3conf/l10n
  post-release:
    - general/manually:
      - vendor/bin/typo3cms install:fixfolderstructure
      - vendor/bin/typo3cms install:generatepackagestates --activate-default=true
      - vendor/bin/typo3cms cache:flush true
      - vendor/bin/typo3cms database:updateschema "*.add,*.change"
      - vendor/bin/typo3cms cache:warmup
  post-deploy:

While using:

pre-deploy:
        - composer/install

Composer will always be called with composer install --dev. Is there a way to call composer with --no-dev instead of --dev?

PS: I already tried - composer/install --no-dev, which generates the following error:

Starting Pre-Deployment tasks:
Task "Composer/installNoDev" not found.

Update Because I needed some more parameters, I used general/manually. My solution is now:

tasks:
  pre-deploy:
    - general/manually:
        - php7.0 /usr/local/bin/composer install --no-dev --no-progress --optimize-autoloader

But on the other hand my, original question was something different. So Chris's answere seems to be correct.

  • 写回答

1条回答 默认 最新

  • dongyang5716 2016-12-14 16:27
    关注

    I think this will work:

    pre-deploy:
      - composer/install: {dev: false}
    

    I couldn't find this in the documentation, but the source references a 'dev' parameter that seems to control --dev / --no-dev:

    public function run()
    {
        $dev = $this->getParameter('dev', true);
        return $this->runCommand($this->getComposerCmd() . ' install' . ($dev ? ' --dev' : ' --no-dev'));
    }
    

    The documentation is a bit more helpful about setting parameters, but I'm not sure if it will correctly read false as a Boolean value.

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

报告相同问题?

悬赏问题

  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突