Browse Source

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

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

+ 5
- 3
Makefile View File

@@ -26,7 +26,9 @@ PROXY             ?= http://proxy.foo.com:8000
26 26
 NO_PROXY          ?= localhost,127.0.0.1,.svc.cluster.local
27 27
 USE_PROXY         ?= false
28 28
 PUSH_IMAGE        ?= false
29
-COMMIT            ?= commit-id
29
+# use this variable for image labels added in internal build process
30
+LABEL             ?= com.internal
31
+COMMIT            ?= $(shell git rev-parse HEAD)
30 32
 IMAGE_NAME        := maas-rack-controller maas-region-controller sstream-cache
31 33
 BUILD_DIR         := $(shell mktemp -d)
32 34
 HELM              := $(BUILD_DIR)/helm
@@ -67,7 +69,7 @@ helm-install:
67 69
 .PHONY: build
68 70
 build:
69 71
 ifeq ($(USE_PROXY), true)
70
-	docker build -t $(IMAGE) --network=host \
72
+	docker build -t $(IMAGE) --label $(LABEL) --network=host \
71 73
 		--label "org.opencontainers.image.revision=$(COMMIT)" \
72 74
 		--label "org.opencontainers.image.created=$(shell date --rfc-3339=seconds --utc)" \
73 75
 		--label "org.opencontainers.image.title=$(IMAGE_NAME)" \
@@ -82,7 +84,7 @@ ifeq ($(USE_PROXY), true)
82 84
 		--build-arg SSTREAM_IMAGE=$(SSTREAM_IMAGE) \
83 85
 		$(IMAGE_DIR)
84 86
 else
85
-	docker build -t $(IMAGE) --network=host \
87
+	docker build -t $(IMAGE) --label $(LABEL) --network=host \
86 88
 		--label "org.opencontainers.image.revision=$(COMMIT)" \
87 89
 		--label "org.opencontainers.image.created=$(shell date --rfc-3339=seconds --utc)" \
88 90
 		--label "org.opencontainers.image.title=$(IMAGE_NAME)" \

Loading…
Cancel
Save