This repository has been archived by the owner on Jan 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathMakefile
115 lines (92 loc) · 3.06 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
# Copyright © 2022-2023 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
.PHONY: clean \
build \
docker-rm \
clean-docker \
run-portainer \
run \
down \
build-image \
GOREPOS= \
as-vending \
as-controller-board-status \
ds-card-reader \
ds-controller-board \
ds-cv-inference \
ms-authentication \
ms-inventory \
ms-ledger \
.PHONY: $(GOREPOS)
getlatest:
git submodule update --init --recursive --remote
docker-rm:
-docker rm -f $$(docker ps -aq)
clean-docker: docker-rm
docker volume prune -f && \
docker network prune -f
run-portainer:
docker compose -f docker-compose.portainer.yml up -d
run:
docker compose -f docker-compose.av.yml -f docker-compose.edgex.yml up -d
run-edgex:
docker compose -f docker-compose.edgex.yml up -d
run-physical:
docker compose -f docker-compose.av.yml -f docker-compose.edgex.yml -f docker-compose.physical.card-reader.yml -f docker-compose.physical.controller-board.yml up -d
run-physical-card-reader:
docker compose -f docker-compose.av.yml -f docker-compose.edgex.yml -f docker-compose.physical.card-reader.yml up -d
run-physical-controller-board:
docker compose -f docker-compose.av.yml -f docker-compose.edgex.yml -f docker-compose.physical.controller-board.yml up -d
down:
-docker compose -f docker-compose.av.yml -f docker-compose.edgex.yml stop -t 1
-docker compose -f docker-compose.av.yml -f docker-compose.edgex.yml down
clean: down docker-rm
docker rmi -f $$(docker images | grep 'automated-vending' | awk '{print $$3}') && \
docker volume prune -f && \
docker network prune -f
docker:
for repo in ${GOREPOS}; do \
echo $$repo; \
cd $$repo; \
make docker || exit 1; \
cd ..; \
done
go-test:
for repo in ${GOREPOS}; do \
echo $$repo; \
cd $$repo; \
make test || exit 1; \
cd ..; \
done
go-lint: go-tidy
@which golangci-lint >/dev/null || echo "WARNING: go linter not installed. To install, run make install-lint"
@which golangci-lint >/dev/null ; echo "running golangci-lint"; golangci-lint version; go version;
for repo in ${GOREPOS}; do \
echo $$repo; \
cd $$repo; \
golangci-lint run --config ../.github/.golangci.yml --out-format=line-number >> ../goLintResults.txt ; \
cd ..; \
done
go-tidy:
for repo in ${GOREPOS}; do \
echo $$repo; \
cd $$repo; \
make tidy || exit 1; \
cd ..; \
done
install-go-lint:
sudo curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b $$(go env GOPATH)/bin v1.51.2
hadolint:
docker run --rm -v $(pwd):/repo -i hadolint/hadolint:latest-alpine sh -c "cd /repo && hadolint -f json ./**/Dockerfile" > go-hadolint.json
gobuild-authentication:
cd ms-authentication && \
cp -r *.json .. && \
cp ./res/configuration.toml ../res/configuration.toml && \
CGO_ENABLED=1 GOOS=linux go build -ldflags='-s -w' -a -installsuffix cgo main.go && \
cp main ..
gobuild-ledger:
cd ms-ledger && \
cp -r *.json .. && \
cp ./res/configuration.toml ../res/configuration.toml && \
CGO_ENABLED=1 GOOS=linux go build -ldflags='-s -w' -a -installsuffix cgo main.go && \
cp main ..