From b9c7b50e7e833bb863cab04a0c8a7b205d0d8006 Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Tue, 10 Dec 2013 18:29:38 -0800 Subject: [PATCH] support base images and disabling of pups --- launcher | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/launcher b/launcher index 83a8e7a..a719d25 100755 --- a/launcher +++ b/launcher @@ -73,10 +73,20 @@ case "$command" in templates=`cat $config_file | docker run -rm -i -a stdin -a stdout $image ruby -e \ "require 'yaml'; puts YAML.load(STDIN.readlines.join)['templates']"` + base_image=`cat $config_file | docker run -rm -i -a stdin -a stdout $image ruby -e \ + "require 'yaml'; puts YAML.load(STDIN.readlines.join)['base_image']"` + + update_pups=`cat $config_file | docker run -rm -i -a stdin -a stdout $image ruby -e \ + "require 'yaml'; puts YAML.load(STDIN.readlines.join)['update_pups']"` + arrTemplates=(${templates// / }) config_data=$(cat $config_file) input="hack: true" + if [[ ! X"" = X"$base_image" ]]; then + image=$base_image + fi + for template in "${arrTemplates[@]}" do [ ! -z $template ] && { @@ -91,8 +101,14 @@ case "$command" in rm -f $cidbootstrap + run_command="cd /pups &&" + if [[ ! "false" = $update_pups ]]; then + run_command="$run_command git pull &&" + fi + run_command="$run_command /pups/bin/pups --stdin" + (exec echo "$input" | docker run -e DOCKER_HOST_IP=$docker_ip -cidfile $cidbootstrap -i -a stdin -a stdout -a stderr $volumes $image \ - /bin/bash -c 'cd /pups && git pull && /pups/bin/pups --stdin') \ + /bin/bash -c "$run_command") \ || (docker rm `cat $cidbootstrap` && rm $cidbootstrap) [ ! -e $cidbootstrap ] && echo "FAILED TO BOOTSTRAP" && exit 1 -- 2.25.1