-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (32 loc) · 1.51 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
$(eval RELEASE_TAG := $(shell jq -r '.release_tag' component.json))
$(eval VERSION := $(shell jq -r '.version' component.json))
$(eval REGISTRY := $(shell jq -r '.registry' component.json))
.PHONY: all build
build:
go mod tidy && go build ./pkg/client/nats
test:
go mod tidy && go test -v -cover ./pkg/model/...
test/integration:
go mod tidy && go test -v --tags=integration ./pkg/model/...
test/bench:
go mod tidy && go test -bench=. -benchmem ./pkg/model/...
test/pack:
go mod tidy && go test -c -o=bin/platform.msgbus.test ./pkg/model/...
go test -c -o=bin/platform.msgbus.integrationtest --tags=integration ./pkg/model/...
clean:
rm -rf ./bin
go clean -modcache
build-consumer:
docker build -t sim/nats/consumer:$(RELEASE_TAG) -f ./build/docker/Dockerfile_consumer .
docker tag sim/nats/consumer:$(RELEASE_TAG) $(REGISTRY)/nats-consumer:$(RELEASE_TAG)
build-producer:
docker build -t sim/nats/producer:$(RELEASE_TAG) -f ./build/docker/Dockerfile_producer .
docker tag sim/nats/producer:$(RELEASE_TAG) $(REGISTRY)/nats-producer:$(RELEASE_TAG)
push-consumer:
docker push $(REGISTRY)/nats-consumer:$(RELEASE_TAG)
docker tag $(REGISTRY)/nats-consumer:$(RELEASE_TAG) $(REGISTRY)/nats-consumer:$(VERSION)-${BUILD_NUMBER}
docker push $(REGISTRY)/nats-consumer:$(VERSION)-${BUILD_NUMBER}
push-producer:
docker push $(REGISTRY)/nats-producer:$(RELEASE_TAG)
docker tag $(REGISTRY)/nats-producer:$(RELEASE_TAG) $(REGISTRY)/nats-producer:$(VERSION)-${BUILD_NUMBER}
docker push $(REGISTRY)/nats-producer:$(VERSION)-${BUILD_NUMBER}