@@ -109,8 +109,6 @@ swaggercheck: swagger
109
109
110
110
.PHONY : build-metadata
111
111
build-metadata : $(if $(findstring ui,$(BUILD_LABELS ) ) , ui)
112
- # do not allow empty $(BUILD_TAGS) (at least add containers_image_openpgp that doesn't affect package import & files listing)
113
- $(eval BUILD_TAGS=$(if $(BUILD_LABELS ) ,$(BUILD_LABELS ) ,containers_image_openpgp) )
114
112
echo " Imports: \n"
115
113
go list -tags $(BUILD_TAGS ) -f ' {{ join .Imports "\n" }}' ./... | sort -u
116
114
echo " \n Files: \n"
@@ -164,53 +162,53 @@ gen-protobuf: check-not-freebds $(PROTOC)
164
162
.PHONY : binary-minimal
165
163
binary-minimal : EXTENSIONS=
166
164
binary-minimal : modcheck build-metadata
167
- env CGO_ENABLED=0 GOOS=$(OS ) GOARCH=$(ARCH ) go build -o bin/zot-$(OS ) -$(ARCH ) -minimal $(BUILDMODE_FLAGS ) -tags containers_image_openpgp - v -trimpath -ldflags " -X zotregistry.dev/zot/pkg/api/config.ReleaseTag=${RELEASE_TAG} -X zotregistry.dev/zot/pkg/api/config.Commit=${COMMIT} -X zotregistry.dev/zot/pkg/api/config.BinaryType=minimal -X zotregistry.dev/zot/pkg/api/config.GoVersion=${GO_VERSION} -s -w" ./cmd/zot
165
+ env CGO_ENABLED=0 GOOS=$(OS ) GOARCH=$(ARCH ) go build -o bin/zot-$(OS ) -$(ARCH ) -minimal $(BUILDMODE_FLAGS ) -v -trimpath -ldflags " -X zotregistry.dev/zot/pkg/api/config.ReleaseTag=${RELEASE_TAG} -X zotregistry.dev/zot/pkg/api/config.Commit=${COMMIT} -X zotregistry.dev/zot/pkg/api/config.BinaryType=minimal -X zotregistry.dev/zot/pkg/api/config.GoVersion=${GO_VERSION} -s -w" ./cmd/zot
168
166
169
167
.PHONY : binary
170
168
binary : $(if $(findstring ui,$(BUILD_LABELS ) ) , ui)
171
169
binary : modcheck build-metadata
172
- env CGO_ENABLED=0 GOOS=$(OS ) GOARCH=$(ARCH ) go build -o bin/zot-$(OS ) -$(ARCH ) $(BUILDMODE_FLAGS ) -tags $(BUILD_LABELS ) ,containers_image_openpgp -v -trimpath -ldflags " -X zotregistry.dev/zot/pkg/api/config.ReleaseTag=${RELEASE_TAG} -X zotregistry.dev/zot/pkg/api/config.Commit=${COMMIT} -X zotregistry.dev/zot/pkg/api/config.BinaryType=$( extended-name) -X zotregistry.dev/zot/pkg/api/config.GoVersion=${GO_VERSION} -s -w" ./cmd/zot
170
+ env CGO_ENABLED=0 GOOS=$(OS ) GOARCH=$(ARCH ) go build -o bin/zot-$(OS ) -$(ARCH ) $(BUILDMODE_FLAGS ) -tags $(BUILD_LABELS ) -v -trimpath -ldflags " -X zotregistry.dev/zot/pkg/api/config.ReleaseTag=${RELEASE_TAG} -X zotregistry.dev/zot/pkg/api/config.Commit=${COMMIT} -X zotregistry.dev/zot/pkg/api/config.BinaryType=$( extended-name) -X zotregistry.dev/zot/pkg/api/config.GoVersion=${GO_VERSION} -s -w" ./cmd/zot
173
171
174
172
.PHONY : binary-debug
175
173
binary-debug : $(if $(findstring ui,$(BUILD_LABELS ) ) , ui)
176
174
binary-debug : modcheck swaggercheck build-metadata
177
- env CGO_ENABLED=0 GOOS=$(OS ) GOARCH=$(ARCH ) go build -o bin/zot-$(OS ) -$(ARCH ) -debug $(BUILDMODE_FLAGS ) -tags $(BUILD_LABELS ) ,debug,containers_image_openpgp -v -gcflags all=' -N -l' -ldflags " -X zotregistry.dev/zot/pkg/api/config.ReleaseTag=${RELEASE_TAG} -X zotregistry.dev/zot/pkg/api/config.Commit=${COMMIT} -X zotregistry.dev/zot/pkg/api/config.BinaryType=$( extended-name) -X zotregistry.dev/zot/pkg/api/config.GoVersion=${GO_VERSION} " ./cmd/zot
175
+ env CGO_ENABLED=0 GOOS=$(OS ) GOARCH=$(ARCH ) go build -o bin/zot-$(OS ) -$(ARCH ) -debug $(BUILDMODE_FLAGS ) -tags $(BUILD_LABELS ) ,debug -v -gcflags all=' -N -l' -ldflags " -X zotregistry.dev/zot/pkg/api/config.ReleaseTag=${RELEASE_TAG} -X zotregistry.dev/zot/pkg/api/config.Commit=${COMMIT} -X zotregistry.dev/zot/pkg/api/config.BinaryType=$( extended-name) -X zotregistry.dev/zot/pkg/api/config.GoVersion=${GO_VERSION} " ./cmd/zot
178
176
179
177
.PHONY : cli
180
178
cli : modcheck build-metadata
181
- env CGO_ENABLED=0 GOOS=$(OS ) GOARCH=$(ARCH ) go build -o bin/zli-$(OS ) -$(ARCH ) $(BUILDMODE_FLAGS ) -tags $(BUILD_LABELS ) ,search,containers_image_openpgp -v -trimpath -ldflags " -X zotregistry.dev/zot/pkg/api/config.Commit=${COMMIT} -X zotregistry.dev/zot/pkg/api/config.BinaryType=$( extended-name) -X zotregistry.dev/zot/pkg/api/config.GoVersion=${GO_VERSION} -s -w" ./cmd/zli
179
+ env CGO_ENABLED=0 GOOS=$(OS ) GOARCH=$(ARCH ) go build -o bin/zli-$(OS ) -$(ARCH ) $(BUILDMODE_FLAGS ) -tags $(BUILD_LABELS ) ,search -v -trimpath -ldflags " -X zotregistry.dev/zot/pkg/api/config.Commit=${COMMIT} -X zotregistry.dev/zot/pkg/api/config.BinaryType=$( extended-name) -X zotregistry.dev/zot/pkg/api/config.GoVersion=${GO_VERSION} -s -w" ./cmd/zli
182
180
183
181
.PHONY : bench
184
182
bench : modcheck build-metadata
185
- env CGO_ENABLED=0 GOOS=$(OS ) GOARCH=$(ARCH ) go build -o bin/zb-$(OS ) -$(ARCH ) $(BUILDMODE_FLAGS ) -tags $(BUILD_LABELS ) ,containers_image_openpgp -v -trimpath -ldflags " -X zotregistry.dev/zot/pkg/api/config.Commit=${COMMIT} -X zotregistry.dev/zot/pkg/api/config.BinaryType=$( extended-name) -X zotregistry.dev/zot/pkg/api/config.GoVersion=${GO_VERSION} -s -w" ./cmd/zb
183
+ env CGO_ENABLED=0 GOOS=$(OS ) GOARCH=$(ARCH ) go build -o bin/zb-$(OS ) -$(ARCH ) $(BUILDMODE_FLAGS ) -tags $(BUILD_LABELS ) -v -trimpath -ldflags " -X zotregistry.dev/zot/pkg/api/config.Commit=${COMMIT} -X zotregistry.dev/zot/pkg/api/config.BinaryType=$( extended-name) -X zotregistry.dev/zot/pkg/api/config.GoVersion=${GO_VERSION} -s -w" ./cmd/zb
186
184
187
185
.PHONY : exporter-minimal
188
186
exporter-minimal : EXTENSIONS=
189
187
exporter-minimal : modcheck build-metadata
190
- env CGO_ENABLED=0 GOOS=$(OS ) GOARCH=$(ARCH ) go build -o bin/zxp-$(OS ) -$(ARCH ) $(BUILDMODE_FLAGS ) -tags containers_image_openpgp - v -trimpath ./cmd/zxp
188
+ env CGO_ENABLED=0 GOOS=$(OS ) GOARCH=$(ARCH ) go build -o bin/zxp-$(OS ) -$(ARCH ) $(BUILDMODE_FLAGS ) -v -trimpath ./cmd/zxp
191
189
192
190
.PHONY : test-prereq
193
191
test-prereq : check-skopeo $(TESTDATA ) $(ORAS )
194
192
195
193
.PHONY : test-extended
196
194
test-extended : $(if $(findstring ui,$(BUILD_LABELS ) ) , ui)
197
195
test-extended : test-prereq
198
- go test -failfast -tags $(BUILD_LABELS ) ,containers_image_openpgp -trimpath -race -timeout 20m -cover -coverpkg ./... -coverprofile=coverage-extended.txt -covermode=atomic ./...
196
+ go test -failfast -tags $(BUILD_LABELS ) -trimpath -race -timeout 20m -cover -coverpkg ./... -coverprofile=coverage-extended.txt -covermode=atomic ./...
199
197
rm -rf /tmp/getter* ; rm -rf /tmp/trivy*
200
198
201
199
.PHONY : test-minimal
202
200
test-minimal : test-prereq
203
- go test -failfast -tags containers_image_openpgp - trimpath -race -cover -coverpkg ./... -coverprofile=coverage-minimal.txt -covermode=atomic ./...
201
+ go test -failfast -trimpath -race -cover -coverpkg ./... -coverprofile=coverage-minimal.txt -covermode=atomic ./...
204
202
rm -rf /tmp/getter* ; rm -rf /tmp/trivy*
205
203
206
204
.PHONY : test-devmode
207
205
test-devmode : $(if $(findstring ui,$(BUILD_LABELS ) ) , ui)
208
206
test-devmode : test-prereq
209
- go test -failfast -tags dev,$(BUILD_LABELS ) ,containers_image_openpgp -trimpath -race -timeout 15m -cover -coverpkg ./... -coverprofile=coverage-dev-extended.txt -covermode=atomic ./pkg/test/... ./pkg/api/... ./pkg/storage/... ./pkg/extensions/sync/... -run ^TestInject
207
+ go test -failfast -tags dev,$(BUILD_LABELS ) -trimpath -race -timeout 15m -cover -coverpkg ./... -coverprofile=coverage-dev-extended.txt -covermode=atomic ./pkg/test/... ./pkg/api/... ./pkg/storage/... ./pkg/extensions/sync/... -run ^TestInject
210
208
rm -rf /tmp/getter* ; rm -rf /tmp/trivy*
211
- go test -failfast -tags dev,containers_image_openpgp -trimpath -race -cover -coverpkg ./... -coverprofile=coverage-dev-minimal.txt -covermode=atomic ./pkg/test/... ./pkg/storage/... ./pkg/extensions/sync/... -run ^TestInject
209
+ go test -failfast -tags dev -trimpath -race -cover -coverpkg ./... -coverprofile=coverage-dev-minimal.txt -covermode=atomic ./pkg/test/... ./pkg/storage/... ./pkg/extensions/sync/... -run ^TestInject
212
210
rm -rf /tmp/getter* ; rm -rf /tmp/trivy*
213
- go test -failfast -tags stress,$(BUILD_LABELS ) ,containers_image_openpgp -trimpath -race -timeout 15m ./pkg/cli/server/stress_test.go
211
+ go test -failfast -tags stress,$(BUILD_LABELS ) -trimpath -race -timeout 15m ./pkg/cli/server/stress_test.go
214
212
215
213
.PHONY : test
216
214
test : $(if $(findstring ui,$(BUILD_LABELS ) ) , ui)
@@ -219,7 +217,7 @@ test: test-extended test-minimal test-devmode
219
217
.PHONY : privileged-test
220
218
privileged-test : $(if $(findstring ui,$(BUILD_LABELS ) ) , ui)
221
219
privileged-test : check-skopeo $(TESTDATA )
222
- go test -failfast -tags needprivileges,$(BUILD_LABELS ) ,containers_image_openpgp -trimpath -race -timeout 15m -cover -coverpkg ./... -coverprofile=coverage-dev-needprivileges.txt -covermode=atomic ./pkg/storage/local/... ./pkg/cli/client/... -run ^TestElevatedPrivileges
220
+ go test -failfast -tags needprivileges,$(BUILD_LABELS ) -trimpath -race -timeout 15m -cover -coverpkg ./... -coverprofile=coverage-dev-needprivileges.txt -covermode=atomic ./pkg/storage/local/... ./pkg/cli/client/... -run ^TestElevatedPrivileges
223
221
224
222
$(TESTDATA ) : check-skopeo
225
223
mkdir -p ${TESTDATA} ; \
@@ -320,8 +318,8 @@ check-logs:
320
318
check : $(if $(findstring ui,$(BUILD_LABELS ) ) , ui)
321
319
check : ./golangcilint.yaml $(GOLINTER )
322
320
mkdir -p pkg/extensions/build; touch pkg/extensions/build/.empty
323
- $(GOLINTER ) --config ./golangcilint.yaml run --enable-all --out-format=colored-line-number --build-tags containers_image_openpgp ./...
324
- $(GOLINTER ) --config ./golangcilint.yaml run --enable-all --out-format=colored-line-number --build-tags $(BUILD_LABELS ) ,containers_image_openpgp ./...
321
+ $(GOLINTER ) --config ./golangcilint.yaml run --enable-all --out-format=colored-line-number ./...
322
+ $(GOLINTER ) --config ./golangcilint.yaml run --enable-all --out-format=colored-line-number --build-tags $(BUILD_LABELS ) ./...
325
323
$(GOLINTER ) --config ./golangcilint.yaml run --enable-all --out-format=colored-line-number --build-tags debug ./pkg/debug/swagger/ ./pkg/debug/gqlplayground
326
324
$(GOLINTER ) --config ./golangcilint.yaml run --enable-all --out-format=colored-line-number --build-tags dev ./pkg/test/inject/
327
325
$(GOLINTER ) --config ./golangcilint.yaml run --enable-all --out-format=colored-line-number --build-tags stress ./pkg/cli/server/
@@ -349,7 +347,7 @@ update-licenses: check-linux
349
347
check-licenses :
350
348
# note: "printf" works for darwin instead of "echo -n"
351
349
go install github.com/google/go-licenses@latest
352
- @for tag in "$(BUILD_LABELS),containers_image_openpgp" "containers_image_openpgp "; do \
350
+ @for tag in "$(BUILD_LABELS)"; do \
353
351
echo Evaluating tag: $$tag;\
354
352
for mod in $$(go list -m -f '{{if not (or .Indirect .Main)}}{{.Path}}{{end}}' all); do \
355
353
while [ x$$mod != x ]; do \
0 commit comments