forked from edgexfoundry/edgex-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
148 lines (112 loc) · 4.04 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
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#
# 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_config_seed docker_export_client docker_export_distro docker_core_data docker_core_metadata docker_core_command docker_support_logging docker_support_notifications docker_sys_mgmt_agent docker_support_scheduler
.PHONY: $(DOCKERS)
MICROSERVICES=cmd/config-seed/config-seed 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 cmd/support-notifications/support-notifications cmd/sys-mgmt-agent/sys-mgmt-agent cmd/support-scheduler/support-scheduler
.PHONY: $(MICROSERVICES)
VERSION=$(shell cat ./VERSION)
GOFLAGS=-ldflags "-X github.com/edgexfoundry/edgex-go.Version=$(VERSION)"
GIT_SHA=$(shell git rev-parse HEAD)
build: $(MICROSERVICES)
go build ./...
cmd/config-seed/config-seed:
$(GO) build $(GOFLAGS) -o $@ ./cmd/config-seed
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
cmd/support-notifications/support-notifications:
$(GO) build $(GOFLAGS) -o $@ ./cmd/support-notifications
cmd/sys-mgmt-agent/sys-mgmt-agent:
$(GO) build $(GOFLAGS) -o $@ ./cmd/sys-mgmt-agent
cmd/support-scheduler/support-scheduler:
$(GO) build $(GOFLAGS) -o $@ ./cmd/support-scheduler
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_config_seed:
docker build \
-f docker/Dockerfile.config-seed \
--label "git_sha=$(GIT_SHA)" \
-t edgexfoundry/docker-core-config-seed-go:$(GIT_SHA) \
-t edgexfoundry/docker-core-config-seed-go:$(VERSION)-dev \
.
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 \
.
docker_support_notifications:
docker build \
-f docker/Dockerfile.support-notifications \
--label "git_sha=$(GIT_SHA)" \
-t edgexfoundry/docker-support-notifications-go:$(GIT_SHA) \
-t edgexfoundry/docker-support-notifications-go:$(VERSION)-dev \
.
docker_support_scheduler:
docker build \
-f docker/Dockerfile.support-scheduler \
--label "git_sha=$(GIT_SHA)" \
-t edgexfoundry/docker-support-scheduler-go:$(GIT_SHA) \
-t edgexfoundry/docker-support-scheduler-go:$(VERSION)-dev \
.