流浪木偶,作曲家无法安装laravel

时间:2016-07-27 10:49:08

标签: laravel vagrant composer-php puppet vagrant-provision

我最近才知道傀儡,而且我试图安装laravel而vagrant正在配置,以便当我登录/ ssh到vagrant时,所有内容都已设置(可以运行laravel)。但是我卡住了,它返回 成功执行 但是在我做了vagrant ssh后, laravel命令不可用。

在此部分代码之前已经安装了php5,php5-cli等作曲家和其他依赖项。

to_internal_value()

输出

"obj.set_track_order (data)"

非常感谢任何帮助。感谢

1 个答案:

答案 0 :(得分:0)

puppet/modules/laravel/files下创建一个文件,并使用以下内容将其命名为composer.json

{                                            
    "require": {                             
        "laravel/installer": "^1.3"          
    }                                        
}

Laravel init.pp文件

class laravel {

    Exec {
        path => "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin",
        user => root,
        group => root,
    }

    file { "/usr/local/bin/laravel-devtools" :
        ensure  => directory,
        owner   => root,
        group   => root,
    }

    file { "/usr/local/bin/laravel-devtools/composer.json" :
        source  => "puppet:///modules/laravel/composer.json",
        require => File["/usr/local/bin/laravel-devtools"],
        owner   => root,
        group   => root,
    }

    exec { "install-laravel" :
        command     => "sudo composer require 'laravel/installer'",
        onlyif      => "test -f /usr/local/bin/composer",
        require     => [
            Package["nginx","php5-cli", "php5-dev", "php5-mysql"], 
            File["/usr/local/bin/laravel-devtools", "/usr/local/bin/laravel-devtools"],
        ],
        environment => ["COMPOSER_HOME=/home/vagrant"],
        cwd         => "/usr/local/bin/laravel-devtools", 
        user        => root, 
        group       => root,
    }

    exec { "set-laravel-as-global" :
        command => "sudo ln -s /usr/local/bin/laravel-devtools/vendor/laravel/installer/laravel /usr/local/bin/laravel",
        require => [
            File["/usr/local/bin/laravel-devtools", "/usr/local/bin/laravel-devtools/composer.json"],
            Exec["install-laravel"],
        ],
    }

}

确保在提供期间首先安装composer