From 619d0db118a8ba9b6977453d0d6d8c6c3a25090f Mon Sep 17 00:00:00 2001 From: Kyle Mathews Date: Thu, 19 Dec 2024 14:19:27 -0700 Subject: [PATCH] Fix yaml --- .buildkite/docker-image.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.buildkite/docker-image.yml b/.buildkite/docker-image.yml index 7f4f09e6ce..de7b1c69f5 100644 --- a/.buildkite/docker-image.yml +++ b/.buildkite/docker-image.yml @@ -26,12 +26,10 @@ steps: - cd ./packages/sync-service - git fetch --tags - export ELECTRIC_VERSION=$(jq '.version' -r package.json) - # Get the latest version from DockerHub - | - DOCKERHUB_VERSION=$(curl -s "https://hub.docker.com/v2/repositories/${DOCKERHUB_REPO}/${IMAGE_NAME}/tags/?page_size=100" | \ - jq -r '.results[] | select(.name | test("^[0-9]+\\.[0-9]+\\.[0-9]+.*$")) | .name' | \ - sort -V | tail -n1 || echo "0.0.0") - # Compare versions and only build if local is newer + DOCKERHUB_VERSION=$(curl -s "https://hub.docker.com/v2/repositories/${DOCKERHUB_REPO}/${IMAGE_NAME}/tags/?page_size=100" \ + | jq -r '.results[] | select(.name | test("^[0-9]+\\.[0-9]+\\.[0-9]+.*$")) | .name' \ + | sort -V | tail -n1 || echo "0.0.0") - | if [ "$(printf '%s\n' "$DOCKERHUB_VERSION" "$ELECTRIC_VERSION" | sort -V | tail -n1)" = "$ELECTRIC_VERSION" ]; then echo "Building new version $ELECTRIC_VERSION (current version on DockerHub is $DOCKERHUB_VERSION)" @@ -42,4 +40,5 @@ steps: . else echo "Current version $ELECTRIC_VERSION is not newer than DockerHub version $DOCKERHUB_VERSION. Skipping build." + exit 0 fi