From 7cf98c73ec9f65f8b34d55994990b9e9654e0f1f Mon Sep 17 00:00:00 2001 From: Evan Reichard Date: Sat, 20 Jan 2024 15:28:53 -0500 Subject: [PATCH] [fix] docker cicd build --- .drone.yml | 10 ++++++++-- Dockerfile | 7 ++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.drone.yml b/.drone.yml index f163ca0..1759f35 100644 --- a/.drone.yml +++ b/.drone.yml @@ -20,8 +20,14 @@ steps: cron: - integration-test - # Publish Dev Docker Image - - name: publish_docker + # Fetch tags + - name: fetch tags + image: alpine/git + commands: + - git fetch --tags + + # Publish docker image + - name: publish docker image: plugins/docker settings: repo: gitea.va.reichard.io/evan/antholume diff --git a/Dockerfile b/Dockerfile index 7c73b30..e7d58ac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,14 +5,15 @@ RUN apk update && apk add ca-certificates # Build Image FROM golang:1.21 AS build +# Create Package Directory +RUN mkdir -p /opt/antholume + # Copy Source WORKDIR /src COPY . . -# Create Package Directory -RUN mkdir -p /opt/antholume - # Compile +RUN git describe --tags RUN go build \ -ldflags "-X reichard.io/antholume/config.version=`git describe --tags`" \ -o /opt/antholume/server