From 47160f16f02f29da4464dce21bfcd0f434f73e07 Mon Sep 17 00:00:00 2001 From: Chris Marslender Date: Thu, 19 Sep 2024 13:54:51 -0500 Subject: [PATCH] Clone the branch instead of trying to fetch to ensure we get a good copy in source ref mode --- docker-entrypoint.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index b9bb79a..dc8b309 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -6,22 +6,23 @@ if [[ -n "${TZ}" ]]; then ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime && echo "$TZ" > /etc/timezone fi -cd /chia-blockchain || exit 1 - # Install alternate version of chia if source mode is requested # Enables testing dev versions of chia-docker in the container even if the version is not published to the container registry if [[ -n ${source_ref} ]]; then echo "Installing chia from source for ref: ${source_ref}" + cd / || exit 1 DEBIAN_FRONTEND=noninteractive apt-get update DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y lsb-release sudo git - rm -rf .penv .venv venv .mypy_cache - git fetch origin "${source_ref}" - git checkout "${source_ref}" + rm -rf /chia-blockchain + git clone --branch "${source_ref}" --recurse-submodules=mozilla-ca https://github.com/Chia-Network/chia-blockchain.git /chia-blockchain + cd /chia-blockchain || exit 1 /bin/sh ./install.sh -s fi +cd /chia-blockchain || exit 1 + # shellcheck disable=SC1091 . ./activate