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
|
from_secret: docker_username
|
||||||
password:
|
password:
|
||||||
from_secret: docker_password
|
from_secret: docker_password
|
||||||
|
build_args:
|
||||||
|
- GIT_TAG_OVERRIDE=${DRONE_TAG}
|
||||||
depends_on:
|
depends_on:
|
||||||
- lint
|
- lint
|
||||||
- test
|
- test
|
||||||
@ -135,12 +137,14 @@ steps:
|
|||||||
- latest
|
- latest
|
||||||
- "${DRONE_TAG}"
|
- "${DRONE_TAG}"
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
target: dind
|
target: binary-only
|
||||||
context: .
|
context: .
|
||||||
username:
|
username:
|
||||||
from_secret: docker_username
|
from_secret: docker_username
|
||||||
password:
|
password:
|
||||||
from_secret: docker_password
|
from_secret: docker_password
|
||||||
|
build_args:
|
||||||
|
- GIT_TAG_OVERRIDE=${DRONE_TAG}
|
||||||
depends_on:
|
depends_on:
|
||||||
- lint
|
- lint
|
||||||
- test
|
- test
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
FROM golang:1.15 as builder
|
FROM golang:1.15 as builder
|
||||||
|
ARG GIT_TAG_OVERRIDE
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY . .
|
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
|
FROM docker:19.03-dind as dind
|
||||||
RUN apk update && apk add bash curl sudo jq git make netcat-openbsd
|
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 ##########
|
########## Tags ##########
|
||||||
|
|
||||||
# get git tag
|
# 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)
|
GIT_TAG ?= $(shell git describe --tags)
|
||||||
ifeq ($(GIT_TAG),)
|
ifeq ($(GIT_TAG),)
|
||||||
GIT_TAG := $(shell git describe --always)
|
GIT_TAG := $(shell git describe --always)
|
||||||
|
Loading…
Reference in New Issue
Block a user