forked from edgexfoundry/edgex-go
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
111 lines (83 loc) · 2.73 KB
/
Copy pathMakefile
File metadata and controls
111 lines (83 loc) · 2.73 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#
# Copyright (c) 2018 Cavium
#
# SPDX-License-Identifier: Apache-2.0
#
.PHONY: build clean test docker run
GO=CGO_ENABLED=0 go
GOCGO=CGO_ENABLED=1 go
DOCKERS=docker_export_client docker_export_distro docker_core_data docker_core_metadata docker_core_command docker_support_logging
.PHONY: $(DOCKERS)
MICROSERVICES=cmd/export-client/export-client cmd/export-distro/export-distro cmd/core-metadata/core-metadata cmd/core-data/core-data cmd/core-command/core-command cmd/support-logging/support-logging
.PHONY: $(MICROSERVICES)
VERSION=$(shell cat ./VERSION)
GOFLAGS=-ldflags "-X github.com/edgexfoundry/edgex-go.Version=$(VERSION)"
GIT_SHA=$(shell git rev-parse --short HEAD)
build: $(MICROSERVICES)
go build ./...
cmd/core-metadata/core-metadata:
$(GO) build $(GOFLAGS) -o $@ ./cmd/core-metadata
cmd/core-data/core-data:
$(GOCGO) build $(GOFLAGS) -o $@ ./cmd/core-data
cmd/core-command/core-command:
$(GO) build $(GOFLAGS) -o $@ ./cmd/core-command
cmd/export-client/export-client:
$(GO) build $(GOFLAGS) -o $@ ./cmd/export-client
cmd/export-distro/export-distro:
$(GOCGO) build $(GOFLAGS) -o $@ ./cmd/export-distro
cmd/support-logging/support-logging:
$(GO) build $(GOFLAGS) -o $@ ./cmd/support-logging
clean:
rm -f $(MICROSERVICES)
test:
go test -cover ./...
go vet ./...
prepare:
glide install
run:
cd bin && ./edgex-launch.sh
run_docker:
cd bin && ./edgex-docker-launch.sh
docker: $(DOCKERS)
docker_core_metadata:
docker build \
-f docker/Dockerfile.core-metadata \
--label "git_sha=$(GIT_SHA)" \
-t edgexfoundry/docker-core-metadata-go:$(GIT_SHA) \
-t edgexfoundry/docker-core-metadata-go:$(VERSION)-dev \
.
docker_core_data:
docker build \
-f docker/Dockerfile.core-data \
--label "git_sha=$(GIT_SHA)" \
-t edgexfoundry/docker-core-data-go:$(GIT_SHA) \
-t edgexfoundry/docker-core-data-go:$(VERSION)-dev \
.
docker_core_command:
docker build \
-f docker/Dockerfile.core-command \
--label "git_sha=$(GIT_SHA)" \
-t edgexfoundry/docker-core-command-go:$(GIT_SHA) \
-t edgexfoundry/docker-core-command-go:$(VERSION)-dev \
.
docker_export_client:
docker build \
-f docker/Dockerfile.export-client \
--label "git_sha=$(GIT_SHA)" \
-t edgexfoundry/docker-export-client-go:$(GIT_SHA) \
-t edgexfoundry/docker-export-client-go:$(VERSION)-dev \
.
docker_export_distro:
docker build \
-f docker/Dockerfile.export-distro \
--label "git_sha=$(GIT_SHA)" \
-t edgexfoundry/docker-export-distro-go:$(GIT_SHA) \
-t edgexfoundry/docker-export-distro-go:$(VERSION)-dev \
.
docker_support_logging:
docker build \
-f docker/Dockerfile.support-logging \
--label "git_sha=$(GIT_SHA)" \
-t edgexfoundry/docker-support-logging-go:$(GIT_SHA) \
-t edgexfoundry/docker-support-logging-go:$(VERSION)-dev \
.