Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
41e254f732 | |||
7ebdfede12 | |||
bb7a2fd08e |
19
.drone.yml
19
.drone.yml
@@ -3,6 +3,11 @@ kind: pipeline
|
|||||||
type: docker
|
type: docker
|
||||||
name: default
|
name: default
|
||||||
|
|
||||||
|
# Platform specification for ARM64 runners
|
||||||
|
platform:
|
||||||
|
os: linux
|
||||||
|
arch: arm64
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Step 1: Check if Docker image for current version already exists
|
# Step 1: Check if Docker image for current version already exists
|
||||||
- name: check-version
|
- name: check-version
|
||||||
@@ -12,14 +17,17 @@ steps:
|
|||||||
commands:
|
commands:
|
||||||
- apk add --no-cache git
|
- apk add --no-cache git
|
||||||
- git fetch --tags
|
- git fetch --tags
|
||||||
- LATEST_TAG=$(git describe --tags --abbrev=0)
|
|
||||||
- echo "Latest Git tag: $LATEST_TAG"
|
|
||||||
- |
|
- |
|
||||||
if docker image inspect apps/homepage:$NEW_VERSION > /dev/null 2>&1; then
|
# Get the latest Git tag
|
||||||
echo "Docker image apps/homepage:$NEW_VERSION already exists — skipping build"
|
LATEST_TAG=$(git describe --tags --abbrev=0)
|
||||||
|
echo "Latest Git tag: $LATEST_TAG"
|
||||||
|
|
||||||
|
# Check if Docker image exists
|
||||||
|
if docker image inspect apps/homepage:$LATEST_TAG > /dev/null 2>&1; then
|
||||||
|
echo "Docker image apps/homepage:$LATEST_TAG already exists — skipping build"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
echo "Docker image apps/homepage:$NEW_VERSION not found — building..."
|
echo "Docker image apps/homepage:$LATEST_TAG not found — building..."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Step 2: Build Docker image with dynamic Git tag
|
# Step 2: Build Docker image with dynamic Git tag
|
||||||
@@ -61,3 +69,4 @@ trigger:
|
|||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
- tag
|
- tag
|
||||||
|
- custom
|
||||||
|
Reference in New Issue
Block a user