diff --git a/.drone.yml b/.drone.yml index e6218d6..ba8d772 100644 --- a/.drone.yml +++ b/.drone.yml @@ -25,8 +25,11 @@ steps: - apk add --no-cache git - git fetch --tags - | - # Get the latest Git tag and export as a Drone env variable - export LATEST_TAG=$(git describe --tags --abbrev=0) + LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null | tr -d '\n') + if [ -z "$LATEST_TAG" ]; then + echo "❌ No git tags found! Cannot continue." + exit 1 + fi echo "Latest Git tag fetched: $LATEST_TAG" # Make it available to downstream steps echo "LATEST_TAG=$LATEST_TAG" >> /drone/env @@ -54,11 +57,6 @@ steps: # - name: dockersock # path: /var/run/docker.sock # commands: - # - | - # if [ -z "$LATEST_TAG" ]; then - # echo "❌ No Git tag found — cannot build." - # exit 1 - # fi # - echo "🔨 Building Docker image apps/homepage:$LATEST_TAG ..." # - docker build --network=host -t apps/homepage:$LATEST_TAG -t apps/homepage:latest /drone/src