Update .drone.yml
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing

using LATEST_TAG instead of DRONE_TAG which not be present if the push itsn't for tag push
This commit is contained in:
2025-10-10 10:22:12 +00:00
parent 1f65582e77
commit a803759384

View File

@@ -49,9 +49,13 @@ steps:
DOCKER_HOST: tcp://192.168.1.111:2376
commands:
- |
IMAGE_TAG=${DRONE_TAG:-latest}
IMAGE_TAG=$(cat /drone/src/LATEST_TAG.txt)
if [ -z "$IMAGE_TAG" ]; then
echo "❌ No tag found in LATEST_TAG.txt — cannot build."
exit 1
fi
echo "🔨 Building Docker image apps/homepage:$IMAGE_TAG ..."
docker build --network=host -t apps/homepage:$IMAGE_TAG .
docker build --network=host -t apps/homepage:$IMAGE_TAG -t apps/homepage:latest
# Step 3: Stop old container (if exists)
- name: stop-old
@@ -70,7 +74,7 @@ steps:
DOCKER_HOST: tcp://192.168.1.111:2376
commands:
- |
IMAGE_TAG=${DRONE_TAG:-latest}
IMAGE_TAG=$(cat /drone/src/LATEST_TAG.txt)
echo "🚀 Starting container apps/homepage:$IMAGE_TAG ..."
docker run -d \
--name homepage \