allow overriding GIT_TAG for make build target to fix publishing docker images

pull/427/head v4.0.0-alpha.1
iwilltry42 4 years ago
parent 96bcb4f9e1
commit 46211ae9d3
No known key found for this signature in database
GPG Key ID: 7BA57AD1CFF16110
  1. 6
      .drone.yml
  2. 3
      Dockerfile
  3. 5
      Makefile

@ -119,6 +119,8 @@ steps:
from_secret: docker_username
password:
from_secret: docker_password
build_args:
- GIT_TAG_OVERRIDE=${DRONE_TAG}
depends_on:
- lint
- test
@ -135,12 +137,14 @@ steps:
- latest
- "${DRONE_TAG}"
dockerfile: Dockerfile
target: dind
target: binary-only
context: .
username:
from_secret: docker_username
password:
from_secret: docker_password
build_args:
- GIT_TAG_OVERRIDE=${DRONE_TAG}
depends_on:
- lint
- test

@ -1,7 +1,8 @@
FROM golang:1.15 as builder
ARG GIT_TAG_OVERRIDE
WORKDIR /app
COPY . .
RUN make build && bin/k3d version
RUN make build -e GIT_TAG_OVERRIDE=${GIT_TAG_OVERRIDE} && bin/k3d version
FROM docker:19.03-dind as dind
RUN apk update && apk add bash curl sudo jq git make netcat-openbsd

@ -16,6 +16,11 @@ export GO111MODULE=on
########## Tags ##########
# get git tag
ifneq ($(GIT_TAG_OVERRIDE),)
$(info GIT_TAG set from env override!)
GIT_TAG := $(GIT_TAG_OVERRIDE)
endif
GIT_TAG ?= $(shell git describe --tags)
ifeq ($(GIT_TAG),)
GIT_TAG := $(shell git describe --always)

Loading…
Cancel
Save