使用 CHEF 下载文件到特定路径
Download files to specific path with CHEF
如何使用CHEF下载文件并指定路径?
我查看了文档并找到了 remote_file 资源,但我无法设法将文件下载到特定路径。
我的尝试是这样的,但不知何故我无法弄清楚确切的语法
remote_file 'E:\' do
source 'https://bintray.com/jfrog/jfrog-cli-go/jfrog-cli-windows-amd64/1.19.0'
show_progress true
action :create_if_missing
end
您需要直接 URL 到文件,您应该使用 /
而不是 \
,这应该可以正常工作:
remote_file 'E:/jfrog.exe' do
checksum "3ddb79b932b34b57a29326a488dcb629049f48277c1568f2d03048cafae38191"
source "https://bintray.com/jfrog/jfrog-cli-go/download_file?file_path=1.19.0/jfrog-cli-windows-amd64/jfrog.exe"
show_progress true
action :create_if_missing
end
我添加了一个校验和,作为 'good practice'。
如何使用CHEF下载文件并指定路径? 我查看了文档并找到了 remote_file 资源,但我无法设法将文件下载到特定路径。
我的尝试是这样的,但不知何故我无法弄清楚确切的语法
remote_file 'E:\' do
source 'https://bintray.com/jfrog/jfrog-cli-go/jfrog-cli-windows-amd64/1.19.0'
show_progress true
action :create_if_missing
end
您需要直接 URL 到文件,您应该使用 /
而不是 \
,这应该可以正常工作:
remote_file 'E:/jfrog.exe' do
checksum "3ddb79b932b34b57a29326a488dcb629049f48277c1568f2d03048cafae38191"
source "https://bintray.com/jfrog/jfrog-cli-go/download_file?file_path=1.19.0/jfrog-cli-windows-amd64/jfrog.exe"
show_progress true
action :create_if_missing
end
我添加了一个校验和,作为 'good practice'。