Composer post-install-cmd没有使用git hook运行

时间:2015-05-19 20:57:31

标签: git laravel phantomjs composer-php

由于某种原因,当我从部署钩子运行composer时,我的post-install-cmd似乎无法运行。

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

为清楚起见,它是' jakoch / phantomjs-installer'我想跑。

如你所见,我的作曲家已经准备就绪。

{
    "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 post hook的输出运行composer install如下:

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

1 个答案:

答案 0 :(得分:1)

到目前为止,答案是在部署挂钩中稍后再运行composer update。所以基本上它运行了两次。

这绝对是一种解决方法,而不是修复方法,但可能让人们感动,而不是我完全坚持使用它的3天。

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