我使用Vagrant启动我的测试环境。不幸的是,我必须在启动我的Vagrant box之前检索信息(密码)。到目前为止,我使用Vagrant-Triggers来完成这个任务,并拥有多个
如何将所有命令移动到一个批处理文件中,然后只需包含该文件?
谢谢你的帮助!
run "do something"
命令。[:up, :provision].each do |cmd|
config.trigger.before cmd, stdout: true do
run "rm -rf #{cookbooks_path}"
run "mkdir -p #{cookbooks_path}"
run "touch fileX"
run "touch fileY"
run "touch fileZ"
end
end
如何将所有命令移动到一个批处理文件中,然后只需包含该文件?
[:up, :provision].each do |cmd|
config.trigger.before cmd, stdout: true do
include_script "Vagrant_trigger_before.sh"
end
end
谢谢你的帮助!
run "Vagrant_trigger_before.sh"
? - Frederic Henri