Update .drone.yml
using LATEST_TAG instead of DRONE_TAG which not be present if the push itsn't for tag push
This commit is contained in:
10
.drone.yml
10
.drone.yml
@@ -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 \
|
||||
|
||||
Reference in New Issue
Block a user