我正在使用 Veewee 构建一个虚拟盒子,我想要一个脚本来调用新创建的盒子上的另一个帮助脚本。
我知道的唯一方法是在 definition.rb
的 postinstall-files
部分提供主脚本和辅助脚本,如下所示:
:postinstall_files => [ "main.sh","helper.sh"]
我的问题是 Veewee 正在尝试执行所有脚本,包括帮助程序脚本(我不想要)。
所以我很感兴趣是否有另一种方法可以在 VM 上传输我的 helper.sh
脚本,以便从 main.sh
脚本中调用。
最佳答案
您可以使用 veewee build hooks像这样:
Veewee::Definition.declare({
:hooks => {
:before_postinstall => Proc.new { definition.box.scp('/tmp/helper.sh', '/home/veewee/helper.sh') }
}
})
关于ruby - 使用 Veewee 创建 VirtualBox 时如何传输一些文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18100277/