lib/hitcher/providers/docker/template.rb in Hitcher-0.1.0 vs lib/hitcher/providers/docker/template.rb in Hitcher-0.1.1

- old
+ new

@@ -23,33 +23,44 @@ case temp when :build_container, :build path = File.join(File.dirname(__FILE__),"templates","linux_mac","1.build.sh.erb") opts = {} opts.merge!(val) - cmd = build_image(opts[:image_name], opts) - bind_template(path,File.join(dest_root,"1.build.sh"), { command: cmd }) + cmd = cb_build_image(opts[:image_name], opts) + f = File.join(dest_root,"1.build.sh") + bind_template(path,f, { command: cmd }) + + FileUtils.chmod "+x", f - when :run_container, :run path = File.join(File.dirname(__FILE__),"templates","linux_mac","2.run_container.sh.erb") opts = {} opts.merge!(val) - cmd = run_container_from_image(opts[:image], opts) - bind_template(path,File.join(dest_root,"2.run_container.sh"), { command: cmd }) + cmd = cb_create_container_from_image(opts[:image], opts) + f = File.join(dest_root,"2.run_container.sh") + bind_template(path,f, { command: cmd }) + FileUtils.chmod "+x", f + when :start_container, :start path = File.join(File.dirname(__FILE__),"templates","linux_mac","3.start_container.sh.erb") opts = {} opts.merge!(val) - cmd = start_container(opts[:container_name], opts) - bind_template(path,File.join(dest_root,"3.start_container.sh"), { command: cmd }) + cmd = cb_start_container(opts[:container_name], opts) + f = File.join(dest_root,"3.start_container.sh") + bind_template(path,f, { command: cmd }) + FileUtils.chmod "+x", f + when :container_prompt, :prompt path = File.join(File.dirname(__FILE__),"templates","linux_mac","4.container_prompt.sh.erb") opts = {} opts.merge!(val) - cmd = container_prompt(opts[:container_name], opts) - bind_template(path,File.join(dest_root,"4.container_prompt.sh"), { command: cmd }) + cmd = cb_run_command_in_container(opts[:container_name], opts) + f = File.join(dest_root,"4.container_prompt.sh") + bind_template(path,f, { command: cmd }) + + FileUtils.chmod "+x", f end end end end