Symfony 3.3 ScriptHandler 不可自动加载

Symfony 3.3 ScriptHandler is not autoloadable

我正在使用 Capistrano 3.10.0gitlab-ci(和 docker)部署到生产环境,但 composer 1.5.2 似乎无法自动加载 ScriptHandler .
注意:composer.lock 是最新的。

这是 Capistrano 错误:

01 Generating optimized autoload files
01 > Incenteev\ParameterHandler\ScriptHandler::buildParameters
01 Updating the "app/config/parameters.yml" file
01 Class Sensio\Bundle\DistributionBundle\Composer\ScriptHandler is not autoloadable, can not call symfony-scripts script
01 Class Sensio\Bundle\DistributionBundle\Composer\ScriptHandler is not autoloadable, can not call symfony-scripts script
01 Class Sensio\Bundle\DistributionBundle\Composer\ScriptHandler is not autoloadable, can not call symfony-scripts script
01 Class Sensio\Bundle\DistributionBundle\Composer\ScriptHandler is not autoLoadable, can not call symfony-scripts script
01 Class Sensio\Bundle\DistributionBundle\Composer\ScriptHandler is not autoloadable, can not call symfony-scripts script
01 deploy@IP 3.002s
00:07 npm:install
01 npm install --production --silent --no-progress
01 added 3 packages in 0.619s
01 deploy@IP 2.613s
00:10 deploy:set_permissions:check
ERROR Cannot change permissions: /home/app/releases/20171106125307/var/logs is not a file or directory (Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy@IP: Cannot change permissions: /home/app/releases/20171106125307/var/logs is not a file or directory

未创建 var/logs 目录,之后部署失败。

composer.json:

{
    "name": "MyApp",
    "description": "MyApp description",
    "license": "proprietary",
    "type": "project",
    "autoload": {
        "psr-4": {
            "": "src/"
        },
        "classmap": [
            "app/AppKernel.php",
            "app/AppCache.php"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\": "tests/"
        }
    },
    "require": {
        "php": ">=7.0",
        "ext-mbstring": "*",
        "ext-soap": "*",
        "symfony/symfony": "^3.3",
        "doctrine/orm": "^2.5",
        "doctrine/doctrine-bundle": "^1.6",
        "symfony/swiftmailer-bundle": "^2.3",
        "symfony/monolog-bundle": "^3.0",
        "symfony/polyfill-apcu": "^1.0",
        "sensio/framework-extra-bundle": "^3.0.2",
        "incenteev/composer-parameter-handler": "^2.0",
        "symfony/assetic-bundle": "^2.8",
        "nesbot/carbon": "^1.22",
        "symfony/workflow": "^3.3",
        "twig/extensions": "^1.4",
        "stof/doctrine-extensions-bundle": "^1.2",
        "csa/guzzle-bundle": "^2.0",
        "symfony/dotenv": "^3.3",
        "sensio/distribution-bundle": "^5.0",
        "beberlei/assert": "^2.7"
    },
    "require-dev": {
        "sensio/generator-bundle": "^3.0",
        "symfony/phpunit-bridge": "^3.0",
        "doctrine/doctrine-fixtures-bundle": "^2.3",
        "fzaninotto/faker": "^1.6",
        "friendsofphp/php-cs-fixer": "^2.6",
        "phpunit/phpunit": "^5.6",
        "jakub-onderka/php-parallel-lint": "^0.9.2",
        "edgedesign/phpqa": "^1.16"
    },
    "scripts": {
        "symfony-scripts": [
            "Incenteev\ParameterHandler\ScriptHandler::buildParameters",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::prepareDeploymentTarget"
        ],
        "post-install-cmd": [
            "@symfony-scripts"
        ],
        "post-update-cmd": [
            "@symfony-scripts"
        ]
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-bin-dir": "bin",
        "symfony-var-dir": "var",
        "symfony-web-dir": "web",
        "symfony-tests-dir": "tests",
        "symfony-assets-install": "relative",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        },
        "branch-alias": null
    }
}

是不是少了什么?

gitlab-cicapistrano 之间发生了混乱。我试图通过 develop 分支部署到生产环境,而 capistrano 正在获取 master(带有 composer.json 错误)...

以上配置有效。