allow overriding GIT_TAG for make build target to fix publishing docker images
This commit is contained in:
parent
96bcb4f9e1
commit
46211ae9d3
@ -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
|
||||
|
5
Makefile
5
Makefile
@ -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…
Reference in New Issue
Block a user