题
我无法让厨师下载我需要在SVN服务器中的配方中使用的文件。
subversion "download installer" do
repository "http://svnrepourl/path/to/installer.msi"
revision "HEAD"
destination "C:\\chef-repo\\cookbooks\\common\\files"
action :export
svn_username "username"
svn_password "password"
end
.
以下是Chef-Client运行的输出:
Compiling Cookbooks...
Converging 1 resources
Recipe: common::svntest
* subversion[download installer] action export[2014-01-09T14:41:42-05:00] INFO
: Processing subversion[download installer] action export (common::svntest line
12)
(up to date)
[2014-01-09T14:41:42-05:00] INFO: Chef Run complete in 1.482104 seconds
[2014-01-09T14:41:42-05:00] INFO: Running report handlers
[2014-01-09T14:41:42-05:00] INFO: Report handlers complete
Chef Client finished, 0 resources updated
.
第12行是“subversion”下载安装程序“do”。不是超级有用的输出 - 我不知道在这里的帽子下发生了什么。它不会在我的系统上的任何位置下载文件 - 目标目录为空。
运行此命令工作正常:svn export -r HEAD http://svnrepourl/path/to/installer.msi --username username --password password C:\chef-repo\cookbooks\common\files
.
它成功从服务器下载文件并将其放在目标中。现在,我可以在执行块中写下这个命令,但我想这样做厨师方式。如何从Windows上从SVN repo下载特定文件?
解决方案
看起来这是厨师中的错误,记录了这里
为了弄清楚我ran chef-client -l debug > log.txt
,它导致我的这些行:
[2014-01-10T09:35:00-05:00] INFO: Processing subversion[download installer] action export (common::svntest line 12)
[2014-01-10T09:35:00-05:00] DEBUG: subversion[download installer] export destination C:\chef-repo\cookbooks\common\files already exists or is a non-empty directory - nothing to do
.
看起来厨师subversion资源需要一个空目录作为目的地(Op中指定的目的地我包含一个文件夹)。请注意,这是 not 使用svn shell命令的情况 - 我能够成功导出到带有它的非空目录。
不隶属于 StackOverflow