Composer安装后cmd未使用git钩子运行

Composer安装后cmd未使用git钩子运行,git,laravel,phantomjs,composer-php,Git,Laravel,Phantomjs,Composer Php,由于某些原因,当从部署挂钩运行composer时,我的安装后cmd似乎没有运行 如果我在安装后立即通过ssh在该框上运行composer install,则安装过程将再次运行,但会运行安装后脚本 为了清楚起见,我想运行的是“jakoch/phantomjs安装程序” 如你所见,我的作曲家已经准备好了 { "name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": ["fra

由于某些原因,当从部署挂钩运行composer时,我的安装后cmd似乎没有运行

如果我在安装后立即通过ssh在该框上运行
composer install
,则安装过程将再次运行,但会运行安装后脚本

为了清楚起见,我想运行的是“jakoch/phantomjs安装程序”

如你所见,我的作曲家已经准备好了

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "laravel/framework": "5.0.*",
        "jakoch/phantomjs-installer": "1.9.8",
        "illuminate/html": "~5.0",
        "guzzlehttp/guzzle": "~5.0"
    },
    "require-dev": {
        "phpunit/phpunit": "~4.0",
        "phpspec/phpspec": "~2.1"
    },
    "autoload": {
        "classmap": [
            "database",
            "app/libraries",
            "app/Models"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize",
            "PhantomInstaller\\Installer::installPhantomJS"
        ],
        "post-update-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize",
            "PhantomInstaller\\Installer::installPhantomJS"
        ],
        "post-create-project-cmd": [
            "php -r \"copy('.env.example', '.env');\"",
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}
post receive钩子的输出运行composer安装,如下所示:

remote: Checking composer.json for Composer dependency... 
remote: Warning: This development build of composer is over 30 days old. It is recommended to update it by running "/var/lib/openshift/5555f3255973ca3b9c00018a/php/usr/bin/composer self-update" to get the latest version.
remote: Loading composer repositories with package information
remote: Installing dependencies (including require-dev) from lock file
remote:   - Installing react/promise (v2.2.0)
remote:     Loading from cache
remote: 
remote:   - Installing guzzlehttp/streams (3.0.0)
remote:     Loading from cache
remote: 
remote:   - Installing guzzlehttp/ringphp (1.0.7)
remote:     Loading from cache
remote: 
remote:   - Installing guzzlehttp/guzzle (5.2.0)
remote:     Loading from cache
remote: 
remote:   - Installing vlucas/phpdotenv (v1.1.0)
remote:     Loading from cache
remote: 
remote:   - Installing symfony/var-dumper (v2.6.7)
remote:     Loading from cache
remote: 
remote:   - Installing symfony/translation (v2.6.7)
remote:     Loading from cache
remote: 
remote:   - Installing symfony/security-core (v2.6.7)
remote:     Loading from cache
remote: 
remote:   - Installing symfony/routing (v2.6.7)
remote:     Loading from cache
remote: 
remote:   - Installing symfony/process (v2.6.7)
remote:     Loading from cache
remote: 
remote:   - Installing symfony/http-foundation (v2.6.7)
remote:     Loading from cache
remote: 
remote:   - Installing symfony/event-dispatcher (v2.6.7)
remote:     Loading from cache
remote: 
remote:   - Installing psr/log (1.0.0)
remote:     Loading from cache
remote: 
remote:   - Installing symfony/debug (v2.6.7)
remote:     Loading from cache
remote: 
remote:   - Installing symfony/http-kernel (v2.6.7)
remote:     Loading from cache
remote: 
remote:   - Installing symfony/finder (v2.6.7)
remote:     Loading from cache
remote: 
remote:   - Installing symfony/console (v2.6.7)
remote:     Loading from cache
remote: 
remote:   - Installing swiftmailer/swiftmailer (v5.4.0)
remote:     Loading from cache
remote: 
remote:   - Installing nikic/php-parser (v1.3.0)
remote:     Loading from cache
remote: 
remote:   - Installing jakub-onderka/php-console-color (0.1)
remote:     Loading from cache
remote: 
remote:   - Installing jakub-onderka/php-console-highlighter (v0.3.1)
remote:     Loading from cache
remote: 
remote:   - Installing dnoegel/php-xdg-base-dir (0.1)
remote:     Loading from cache
remote: 
remote:   - Installing psy/psysh (v0.4.4)
remote:     Loading from cache
remote: 
remote:   - Installing nesbot/carbon (1.19.0)
remote:     Loading from cache
remote: 
remote:   - Installing mtdowling/cron-expression (v1.0.4)
remote:     Loading from cache
remote: 
remote:   - Installing monolog/monolog (1.13.1)
remote:     Loading from cache
remote: 
remote:   - Installing league/flysystem (1.0.3)
remote:     Loading from cache
remote: 
remote:   - Installing jeremeamia/superclosure (2.1.0)
remote:     Loading from cache
remote: 
remote:   - Installing ircmaxell/password-compat (v1.0.4)
remote:     Loading from cache
remote: 
remote:   - Installing doctrine/inflector (v1.0.1)
remote:     Loading from cache
remote: 
remote:   - Installing danielstjules/stringy (1.9.0)
remote:     Loading from cache
remote: 
remote:   - Installing symfony/filesystem (v2.6.7)
remote:     Loading from cache
remote: 
remote:   - Installing classpreloader/classpreloader (1.3.0)
remote:     Loading from cache
remote: 
remote:   - Installing laravel/framework (v5.0.31)
remote:     Loading from cache
remote: 
remote:   - Installing illuminate/html (v5.0.0)
remote:     Loading from cache
remote: 
remote:   - Installing jakoch/phantomjs-installer (1.9.8)
remote:     Loading from cache
remote: 
remote:   - Installing phpdocumentor/reflection-docblock (2.0.4)
remote:     Loading from cache
remote: 
remote:   - Installing symfony/yaml (v2.6.7)
remote:     Loading from cache
remote: 
remote:   - Installing sebastian/recursion-context (1.0.0)
remote:     Loading from cache
remote: 
remote:   - Installing sebastian/exporter (1.2.0)
remote:     Loading from cache
remote: 
remote:   - Installing sebastian/diff (1.3.0)
remote:     Loading from cache
remote: 
remote:   - Installing sebastian/comparator (1.1.1)
remote:     Loading from cache
remote: 
remote:   - Installing doctrine/instantiator (1.0.4)
remote:     Loading from cache
remote: 
remote:   - Installing phpspec/prophecy (v1.4.1)
remote:     Loading from cache
remote: 
remote:   - Installing phpspec/php-diff (v1.0.2)
remote:     Loading from cache
remote: 
remote:   - Installing phpspec/phpspec (2.2.0)
remote:     Loading from cache
remote: 
remote:   - Installing phpunit/php-token-stream (1.4.1)
remote:     Loading from cache
remote: 
remote:   - Installing sebastian/version (1.0.5)
remote:     Loading from cache
remote: 
remote:   - Installing sebastian/global-state (1.0.0)
remote:     Loading from cache
remote: 
remote:   - Installing sebastian/environment (1.2.2)
remote:     Loading from cache
remote: 
remote:   - Installing phpunit/php-text-template (1.2.0)
remote:     Loading from cache
remote: 
remote:   - Installing phpunit/phpunit-mock-objects (2.3.1)
remote:     Loading from cache
remote: 
remote:   - Installing phpunit/php-timer (1.0.5)
remote:     Loading from cache
remote: 
remote:   - Installing phpunit/php-file-iterator (1.4.0)
remote:     Loading from cache
remote: 
remote:   - Installing phpunit/php-code-coverage (2.0.16)
remote:     Loading from cache
remote: 
remote:   - Installing phpunit/phpunit (4.6.6)
remote:     Loading from cache
remote: 
remote: symfony/var-dumper suggests installing ext-symfony_debug ()
remote: symfony/translation suggests installing symfony/config ()
remote: symfony/security-core suggests installing symfony/expression-language (For using the expression voter)
remote: symfony/security-core suggests installing symfony/validator (For using the user password constraint)
remote: symfony/routing suggests installing doctrine/annotations (For using the annotation loader)
remote: symfony/routing suggests installing symfony/config (For using the all-in-one router or any loader)
remote: symfony/routing suggests installing symfony/expression-language (For using expression matching)
remote: symfony/event-dispatcher suggests installing symfony/dependency-injection ()
remote: symfony/http-kernel suggests installing symfony/browser-kit ()
remote: symfony/http-kernel suggests installing symfony/class-loader ()
remote: symfony/http-kernel suggests installing symfony/config ()
remote: symfony/http-kernel suggests installing symfony/dependency-injection ()
remote: psy/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to work.)
remote: monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)
remote: monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
remote: monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
remote: monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server)
remote: monolog/monolog suggests installing raven/raven (Allow sending log messages to a Sentry server)
remote: monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar)
remote: monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)
remote: monolog/monolog suggests installing videlalvaro/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib)
remote: league/flysystem suggests installing league/flysystem-aws-s3-v2 (Allows you to use S3 storage with AWS SDK v2)
remote: league/flysystem suggests installing league/flysystem-aws-s3-v3 (Allows you to use S3 storage with AWS SDK v3)
remote: league/flysystem suggests installing league/flysystem-azure (Allows you to use Windows Azure Blob storage)
remote: league/flysystem suggests installing league/flysystem-cached-adapter (Flysystem adapter decorator for metadata caching)
remote: league/flysystem suggests installing league/flysystem-copy (Allows you to use Copy.com storage)
remote: league/flysystem suggests installing league/flysystem-dropbox (Allows you to use Dropbox storage)
remote: league/flysystem suggests installing league/flysystem-eventable-filesystem (Allows you to use EventableFilesystem)
remote: league/flysystem suggests installing league/flysystem-rackspace (Allows you to use Rackspace Cloud Files)
remote: league/flysystem suggests installing league/flysystem-sftp (Allows you to use SFTP server storage via phpseclib)
remote: league/flysystem suggests installing league/flysystem-webdav (Allows you to use WebDAV storage)
remote: league/flysystem suggests installing league/flysystem-ziparchive (Allows you to use ZipArchive adapter)
remote: league/flysystem suggests installing predis/predis (Allows you to use Predis for caching)
remote: laravel/framework suggests installing aws/aws-sdk-php (Required to use the SQS queue driver and SES mail driver (~2.4).)
remote: laravel/framework suggests installing doctrine/dbal (Required to rename columns and drop SQLite columns (~2.4).)
remote: laravel/framework suggests installing iron-io/iron_mq (Required to use the iron queue driver (~1.5).)
remote: laravel/framework suggests installing league/flysystem-aws-s3-v2 (Required to use the Flysystem S3 driver (~1.0).)
remote: laravel/framework suggests installing league/flysystem-rackspace (Required to use the Flysystem Rackspace driver (~1.0).)
remote: laravel/framework suggests installing pda/pheanstalk (Required to use the beanstalk queue driver (~3.0).)
remote: laravel/framework suggests installing predis/predis (Required to use the redis cache and queue drivers (~1.0).)
remote: phpdocumentor/reflection-docblock suggests installing dflydev/markdown (~1.0)
remote: phpdocumentor/reflection-docblock suggests installing erusev/parsedown (~1.0)
remote: phpspec/phpspec suggests installing phpspec/nyan-formatters (~1.0 – Adds Nyan formatters)
remote: sebastian/global-state suggests installing ext-uopz (*)
remote: phpunit/php-code-coverage suggests installing ext-xdebug (>=2.2.1)
remote: phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)
但从不安装实际的文件,我需要在ssh中手动运行
composer install
,这样可以:

[teampro-propduck.rhcloud.com repo]\> composer install
Warning: This development build of composer is over 30 days old. It is recommended to update it by running "/var/lib/openshift/5555f3255973ca3b9c00018a/php/usr/bin/composer self-update" to get the latest version.
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
Generating optimized class loader
Compiling common classes
  - Installing phantomjs (1.9.8)
    Loading from cache

到目前为止,答案是在部署挂钩的稍后点运行额外的
composer更新。所以基本上它会运行两次

这肯定是一个解决办法,而不是修复,但可能会让人们移动,而不是我花了3天时间完全陷入其中


如果我得到进一步的正确修复,将会更新。

嘿,Ryk,我不确定为什么
phantomjs安装程序
没有被钩子触发。您是否可以在详细模式下运行Composer(从Git钩子中)以获得更多关于正在进行的操作的详细信息:
Composer安装-vvv
?不幸的是,似乎Composer是由openshift使用标记文件调用的,因此我无法控制钩子上不工作的输出。到目前为止,解决方法是在我可以控制的钩子的稍后阶段调用
composer update
。似乎在工作,但似乎是一种浪费!啊,好的。是的,运行
composer update
是不必要的附加步骤。-猜测:是否执行了
php artisan optimize
?这是一个
1.9.8
问题(尝试提升到
2.0.0
)-2.0.0将不会安装幻影,因为二进制文件尚未发布,但至少您可以测试安装程序是否已执行。-我无法重现这个问题,如果没有调试信息,我们就会陷入困境。请随时打开一个错误报告,也许其他人遇到或有相同的问题,并能够提供帮助。谢谢,JensYeah我同意,我将尝试等待linux 2.0.0版本发布,然后看看会发生什么。解决方案目前还可以,只需在部署脚本中增加一分钟(而不是世界末日)。我当然会更新这个当我得到它的底部。