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

如何告诉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.

图片转代码服务由CSDN问答提供 功能建议

我正在尝试使用 Magallanes

这是我的实际任务配置:

 任务:
预部署:
  -  composer / install 
 on-  deploy:
  -  filesystem / link-shared-files:
 linked_folders:
  -  web / fileadmin 
  -  web / uploads 
  -  web / typo3temp 
  -  web / typo3conf / l10n 
 post-release:\  n  -  general / manual:
  -  vendor / bin / typo3cms install:fixfolderstructure 
  -  vendor / bin / typo3cms install:generatepackagestates --activate-default = true 
  -  vendor / bin / typo3cms cache:flush true 
  -  vendor / bin / typo3cms数据库:updateschema“* .add,* .change”
  -  vendor / bin / typo3cms cache:warmup 
 post-deploy:
   
 
 

使用时:

 预部署:
  -  composer / install 
   
 
 

将始终调用Composer 使用 composer install --dev 。 有没有办法用 - no-dev 而不是 - dev 调用composer?

PS:我已经尝试过 - composer / install --no-dev ,它会产生以下错误:

启动预部署任务:
找不到任务“Composer / installNoDev”。

更新 因为我需要更多参数,我使用 general / manual 。 我的解决方案现在是:

 任务:
预部署:
  - 一般/手动:
  -  php7.0 / usr / local / bin / composer install  -  -no-dev --no-progress --optimize-autoloader 
   
 
 

但另一方面,我原来的问题是不同的。 所以克里斯的回答似乎是正确的。

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

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.

    打赏 评论

相关推荐 更多相似问题