Skip to content
This repository has been archived by the owner on Sep 28, 2024. It is now read-only.

Don't always require --ignore-buildable during image pull #137

Merged
merged 1 commit into from
Aug 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion ops/bin/local-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,25 @@ fi;
# Pulling images
echo -n "Pulling docker images 📥"
T0=$(date +%s%N | cut -b1-13)
DOCKER_PULL_LOGS=$("$REPO_DIR"/ops/bin/local-cmd.sh pull --ignore-buildable -q 2>&1)
EXTRA_PULL_FLAGS=
if [ -z ${HOCUS_BUILD_COMMIT_HASH+x} ]; then
# When building images locally this flag is needed
EXTRA_PULL_FLAGS=--ignore-buildable
# Check minimum version of docker compose
# We require docker compose of at least version 2.15.0 which introduced --ignore-buildable
COMPOSE_VERSION="$(docker compose version | grep -o -E '[0-9]+(\.[0-9]+){2}$')"
COMPOSE_REQUIRED_VERSION="2.15.0"
if ! [ "$(printf '%s\n' "$COMPOSE_REQUIRED_VERSION" "$COMPOSE_VERSION" | sort -V | head -n1)" = "$COMPOSE_REQUIRED_VERSION" ]; then
T1=$(date +%s%N | cut -b1-13)
DT=$(printf %.2f\\n "$(( $T1 - $T0 ))e-3")
echo -e "\r\033[KPulling docker images 📥 - ❌ in $DT"
echo "When building local images Hocus requires docker compose to be least version $COMPOSE_REQUIRED_VERSION, the local version is $COMPOSE_VERSION"
echo "Consult the docker compose documentation on how to upgrade https://docs.docker.com/compose/install/linux/#install-using-the-repository"
exit 1
fi
fi

DOCKER_PULL_LOGS=$("$REPO_DIR"/ops/bin/local-cmd.sh pull $EXTRA_PULL_FLAGS -q 2>&1)
if ! [[ $? -eq 0 ]]; then
T1=$(date +%s%N | cut -b1-13)
DT=$(printf %.2f\\n "$(( $T1 - $T0 ))e-3")
Expand Down