From: Sam Date: Thu, 26 May 2016 07:07:13 +0000 (+1000) Subject: Improve rebuild experience, don't fail after upgrading db X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b4ab14c222efe50d86b9fabefa3fc4c0f9ef3acd;p=discourse_docker.git Improve rebuild experience, don't fail after upgrading db --- diff --git a/launcher b/launcher index 36754cf..d1f6b78 100755 --- a/launcher +++ b/launcher @@ -495,9 +495,17 @@ run_bootstrap() { echo $run_command - unset FAILED + unset ERR (exec echo "$input" | $docker_path run $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") || FAILED="TRUE" + /bin/bash -c "$run_command") || ERR=$? + + unset FAILED + # magic exit code that indicates a retry + if [[ "$ERR" == 77 ]]; then + exit 77 + else + FAILED=TRUE + fi if [[ $FAILED = "TRUE" ]]; then if [[ ! -z "$DEBUG" ]]; then diff --git a/templates/postgres.template.yml b/templates/postgres.template.yml index 692ceb5..84d323b 100644 --- a/templates/postgres.template.yml +++ b/templates/postgres.template.yml @@ -77,12 +77,12 @@ run: if [ "$PG_MAJOR_OLD" = "9.2" ]; then echo Add the line: 'base_image: "samsaffron/discourse:0.1.1"' - echo Change: "templates/postgres.template.yml TO templates/postgres.9.2.template.yml" + echo 'In containers/app.yml: Change "templates/postgres.template.yml" TO "templates/postgres.9.2.template.yml"' echo fi if [ "$PG_MAJOR_OLD" = "9.3" ]; then - echo Change: "templates/postgres.template.yml TO templates/postgres.9.3.template.yml" + echo 'In containers/app.yml: Change "templates/postgres.template.yml" TO "templates/postgres.9.3.template.yml"' echo fi @@ -118,7 +118,8 @@ run: echo echo Please run "./launcher bootstrap" again echo ------------------------------------------------------------------------------------- - exit 1 + # Magic exit status to denote no failure + exit 77 fi - exec: cmd: