From a87474c239f867ecf8f531644410b0a83f755f20 Mon Sep 17 00:00:00 2001 From: Gabe Pacuilla Date: Fri, 28 Jan 2022 14:47:14 -0500 Subject: [PATCH] DEV: update launcher for new base image and pups gem (#602) --- launcher | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/launcher b/launcher index 23189e5..6de6672 100755 --- a/launcher +++ b/launcher @@ -91,7 +91,7 @@ git_rec_version='1.8.0' config_file=containers/"$config".yml cidbootstrap=cids/"$config"_bootstrap.cid local_discourse=local_discourse -image="discourse/base:2.0.20211118-0105" +image="discourse/base:2.0.20220128-1817" docker_path=`which docker.io 2> /dev/null || which docker` git_path=`which git` @@ -662,13 +662,21 @@ run_bootstrap() { rm -f $cidbootstrap - run_command="cd /pups &&" - if [[ ! "false" = $update_pups ]]; then - run_command="$run_command git pull && git checkout $pups_version &&" + unset ERR + + $docker_path run $user_args --rm -i $image gem which pups || ERR=$? + if [[ "$ERR" ]]; then + # Fallback to git pull method here if `pups` was not installed by gem in base image + pups_command="cd /pups &&" + if [[ ! "false" = $update_pups ]]; then + pups_command="$pups_command git pull && git checkout $pups_version &&" + fi + pups_command="$pups_command /pups/bin/pups --stdin" + else + pups_command="/usr/local/bin/pups --stdin" fi - run_command="$run_command /pups/bin/pups --stdin" - echo $run_command + echo $pups_command unset ERR @@ -676,7 +684,7 @@ run_bootstrap() { echo "$input" > "$tmp_input_file" (exec cat "$tmp_input_file" | $docker_path run --shm-size=512m $user_args $links "${env[@]}" -e DOCKER_HOST_IP="$docker_ip" --cidfile $cidbootstrap -i -a stdin -a stdout -a stderr $volumes $image \ - /bin/bash -c "$run_command") || ERR=$? + /bin/bash -c "$pups_command") || ERR=$? rm -f "$tmp_input_file" -- 2.25.1