forked from edgexfoundry/device-mqtt-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (26 loc) · 766 Bytes
/
Makefile
File metadata and controls
40 lines (26 loc) · 766 Bytes
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
38
39
40
.PHONY: build test clean prepare update docker
GO = CGO_ENABLED=0 GO111MODULE=on go
MICROSERVICES=cmd/device-mqtt
.PHONY: $(MICROSERVICES)
DOCKERS=docker_device_mqtt_go
.PHONY: $(DOCKERS)
VERSION=$(shell cat ./VERSION)
GIT_SHA=$(shell git rev-parse HEAD)
GOFLAGS=-ldflags "-X github.com/edgexfoundry/device-mqtt-go.Version=$(VERSION)"
build: $(MICROSERVICES)
$(GO) build ./...
cmd/device-mqtt:
$(GO) build $(GOFLAGS) -o $@ ./cmd
test:
$(GO) test ./... -coverprofile=coverage.out
clean:
rm -f $(MICROSERVICES)
run:
cd bin && ./edgex-launch.sh
docker: $(DOCKERS)
docker_device_mqtt_go:
docker build \
--label "git_sha=$(GIT_SHA)" \
-t edgexfoundry/docker-device-mqtt-go:$(GIT_SHA) \
-t edgexfoundry/docker-device-mqtt-go:$(VERSION)-dev \
.