exit 1
}
+host_run() {
+ read -r -d '' env_ruby << 'RUBY'
+ require 'yaml'
+
+ input = STDIN.readlines.join
+ yaml = YAML.load(input)
+
+ if host_run = yaml['host_run']
+ params = yaml['params'] || {}
+ host_run.each do |run|
+ params.each do |k,v|
+ run = run.gsub("$#{k}", v)
+ end
+ STDOUT.write "#{run}--SEP--"
+ end
+ end
+RUBY
+
+ host_run=`cat $config_file | $docker_path run --rm -i -a stdout -a stdin $image ruby -e "$env_ruby"`
+
+ while [ "$host_run" ] ; do
+ iter=${host_run%%--SEP--*}
+ echo
+ echo "Host run: $iter"
+ $iter || exit 1
+ echo
+ host_run="${host_run#*--SEP--}"
+ done
+}
+
+
set_volumes() {
volumes=`cat $config_file | $docker_path run --rm -i -a stdout -a stdin $image ruby -e \
"require 'yaml'; puts YAML.load(STDIN.readlines.join)['volumes'].map{|v| '-v ' << v['volume']['host'] << ':' << v['volume']['guest'] << ' '}.join"`
run_start(){
+ host_run
+
if [ ! -e $cidfile ]
then
echo "No cid found, creating a new container"
}
run_bootstrap(){
+
+ host_run
+
get_ssh_pub_key
# Is the image available?