Composer更新通过puppet运行了

我正在使用composer来管理依赖项。 基本上我想要做的是在 vagrant up </ code>运行时在puppet配置中自动运行 composer update </ code>。</ p>

我正在使用 puphpet为vagrant生成puppet文件。</ p>

我在 default.pp </ code>文件的代码中添加了 composer :: exec </ code>部分: </ p>

  if $ php_values ['composer'] == 1 {
class {'composer':
target_dir =&gt; '/ usr / local / bin',
composer_file =&gt; 'composer',
download_method =&gt; 'curl',
logoutput =&gt; 是的,
tmp_path =&gt; '/ tmp',
php_package =&gt; “$ {php :: params :: module_prefix} cli”,
curl_package =&gt; 'curl',
suhosin_enabled =&gt; false,
}

composer :: exec {'composer-update':
cmd =&gt; 'update',
cwd =&gt; '/ var / www / myproject'
}
}
</ code> </ pre>

有时我在输出中收到此错误:</ p>

 错误:命令超出超时
错误:/ Stage [main] // Composer :: Exec [composer-update] / Exec [composer_update_composer-update] /返回:从notrun更改为0失败:命令超出超时
</ code> </ pre>

木偶作曲家中没有 timeout </ code>属性。</ p>

如何解决? </ p>
</ div>

展开原文

原文

I'm using composer to manage dependencies. And basically want I want to do is automatically run composer update in puppet config when vagrant up is running.

I'm using puphpet to generate puppet files for vagrant.

I added composer::exec section in this code in the default.pp file:

if $php_values['composer'] == 1 {
  class { 'composer':
    target_dir      => '/usr/local/bin',
    composer_file   => 'composer',
    download_method => 'curl',
    logoutput       => true,
    tmp_path        => '/tmp',
    php_package     => "${php::params::module_prefix}cli",
    curl_package    => 'curl',
    suhosin_enabled => false,
  }

  composer::exec { 'composer-update':
    cmd             => 'update',
    cwd             => '/var/www/myproject'
  }
}

Some times I'm getting this error in output:

Error: Command exceeded timeout
Error: /Stage[main]//Composer::Exec[composer-update]/Exec[composer_update_composer-update]/returns: change from notrun to 0 failed: Command exceeded timeout

And there is no timeout property in puppet composer.

How to solve it?

duanqiao8925
duanqiao8925 不,'composerinstall'是您在生成锁文件时要做的事情-getcomposer.org/doc/...以避免在实时服务器上运行更新。
接近 7 年之前 回复
douyuan3842
douyuan3842 如果我通过ssh登录,我可以运行作曲家更新,它的工作原理。据我所知,作曲家安装你需要运行,如果你没有composer.json,但我有。puppetcomposerexec命令中没有超时属性:(
接近 7 年之前 回复
dongleiqiao2107
dongleiqiao2107 那是一个傀儡错误信息。您可以尝试将exec任务的'timeout'设置为更长。顺便说一句,你知道你应该运行'composerinstall'而不是更新。
接近 7 年之前 回复

1个回答



看看 http://docs.puppetlabs.com/references/latest/type.html#exec-attribute-timeout - 可以为exec资源设置超时 。 如果puppet composer模块没有提供覆盖它的选项,它确实应该IMO。 如果有可能它是作曲家本身的超时,而不是木偶执行,你想尝试</ p>

  export COMPOSER_PROCESS_TIMEOUT = 600 
</ code> </ pre>

</ div>

展开原文

原文

Take a look at http://docs.puppetlabs.com/references/latest/type.html#exec-attribute-timeout - it is possible to set a timeout for an exec resource. If the puppet composer module does not provide an option to override that, it really should IMO. And if by a chance it is composer itself that's timing out, not puppet exec, you'd wanna try

export COMPOSER_PROCESS_TIMEOUT=600

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问