Browse Source

Merge "Fix: adding back the possibility to add arbitrary labels"

Zuul 5 months ago
parent
commit
018919ea5c
1 changed files with 5 additions and 3 deletions
  1. 5
    3
      Makefile

+ 5
- 3
Makefile View File

@@ -21,7 +21,9 @@ PROXY           ?= http://proxy.foo.com:8000
21 21
 NO_PROXY        ?= localhost,127.0.0.1,.svc.cluster.local
22 22
 USE_PROXY       ?= false
23 23
 PUSH_IMAGE      ?= false
24
-COMMIT          ?= commit-id
24
+# use this variable for image labels added in internal build process
25
+LABEL           ?= com.internal
26
+COMMIT          ?= $(shell git rev-parse HEAD)
25 27
 IMAGE           := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG}
26 28
 
27 29
 # Build Deckhand Docker image for this project
@@ -52,7 +54,7 @@ tests:
52 54
 .PHONY: build_deckhand
53 55
 build_deckhand:
54 56
 ifeq ($(USE_PROXY), true)
55
-	docker build --network host -t $(IMAGE) \
57
+	docker build --network host -t $(IMAGE) --label $(LABEL) \
56 58
 		--label "org.opencontainers.image.revision=$(COMMIT)" \
57 59
 		--label "org.opencontainers.image.created=$(shell date --rfc-3339=seconds --utc)" \
58 60
 		--label "org.opencontainers.image.title=$(IMAGE_NAME)" \
@@ -64,7 +66,7 @@ ifeq ($(USE_PROXY), true)
64 66
 		--build-arg no_proxy=$(NO_PROXY) \
65 67
 		--build-arg NO_PROXY=$(NO_PROXY) .
66 68
 else
67
-	docker build --network host -t $(IMAGE) \
69
+	docker build --network host -t $(IMAGE) --label $(LABEL) \
68 70
 		--label "org.opencontainers.image.revision=$(COMMIT)" \
69 71
 		--label "org.opencontainers.image.created=$(shell date --rfc-3339=seconds --utc)" \
70 72
 		--label "org.opencontainers.image.title=$(IMAGE_NAME)" \

Loading…
Cancel
Save