From 0af6a2c32f04f1c0f8b98e1be9fa45983eec9bd5 Mon Sep 17 00:00:00 2001 From: Kevin Morris Date: Fri, 29 Oct 2021 23:47:47 -0700 Subject: [PATCH] fix(docker): fix COMMIT_HASH variable check The previous method was super bad. Even if a variable was declared, if it was empty, we would run into a false-positive. Additionally, the previous method did not allow us to not specify the COMMIT_HASH variable; which is problematic for development environments. Signed-off-by: Kevin Morris --- docker/fastapi-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/fastapi-entrypoint.sh b/docker/fastapi-entrypoint.sh index ec9eb5c1..58fafe56 100755 --- a/docker/fastapi-entrypoint.sh +++ b/docker/fastapi-entrypoint.sh @@ -11,7 +11,7 @@ sed -ri "s;^(aur_location) = .+;\1 = ${AURWEB_FASTAPI_PREFIX};" conf/config sed -ri 's/^(cache) = .+/\1 = redis/' conf/config sed -ri 's|^(redis_address) = .+|\1 = redis://redis|' conf/config -if [ "$COMMIT_HASH" ]; then +if [ ! -z ${COMMIT_HASH+x} ]; then sed -ri "s/^;?(commit_hash) =.*$/\1 = $COMMIT_HASH/" conf/config fi