diff --git a/run.sh b/run.sh index 4b62fad..a191eca 100755 --- a/run.sh +++ b/run.sh @@ -23,31 +23,32 @@ function cleanup(){ function build () { local config="$1" - local location="$2" + local configs="./configs" + local images="./images" # file:// cannot have relative paths, so use a bit of subsitution to fix - if grep -q SKYNET_ROOT_DIR "$config"; then + if grep -q SKYNET_ROOT_DIR "$configs/$config.yaml"; then # create a copy with the file - cp "$config" "$config.tmp" + cp "$configs/$config.yaml" "$configs/$config.tmp" # sed normally uses / but that conflcts with file paths so use @ instead - sed -i "s@SKYNET_ROOT_DIR@$PWD@g" "$config.tmp" + sed -i "s@SKYNET_ROOT_DIR@$PWD@g" "$configs/$config.tmp" # add to tmp tmp_files - tmp_files+=("$config.tmp") + tmp_files+=("$configs/$config.tmp") # normal command - distrobuilder build-lxc "$config.tmp" $location + distrobuilder build-lxc "$configs/$config.tmp" "$images/$config" else - distrobuilder build-lxc $config $location + distrobuilder build-lxc "$configs/$config.yaml" "$images/$config" fi } function main(){ setup - build ./configs/base.yaml ./images/base - build ./configs/base_trainee.yaml ./images/base_trainee + build base + build base_trainee cleanup }