-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
58 lines (47 loc) · 2 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
VERSION = latest-$(shell git log --pretty=format:'%h' -n 1)
all: ems generator
.PHONY: influxdb
influxdb:
$(eval LATEST_DAEMON=$(shell wget -q -O- https://www.influxdata.com/downloads/ | grep ">wget https://download.influxdata.com/influxdb/releases/influxdb2" | grep "linux" | grep "amd64" | awk '{printf $$2 "\n"}'))
$(eval LATEST_CLIENT=$(shell wget -q -O- https://www.influxdata.com/downloads/ | grep ">wget https://dl.influxdata.com/influxdb/releases/influxdb2-client" | grep "linux" | grep "amd64" | awk '{printf $$2 "\n"}'))
$(eval INFLUXD_VERSION=$(shell echo $(LATEST_DAEMON) | awk '{printf $$1}' | grep -o -E "[0-9]+\.[0-9]+\.[0-9]+"))
wget -q -O - $(shell echo $(LATEST_DAEMON) | awk '{printf $$1}') | tar -zxv influxdb2-$(shell echo $(INFLUXD_VERSION))/usr/bin/influxd --transform 's/influxdb2-$(shell echo $(INFLUXD_VERSION))\/usr\/bin\/influxd/bin\/influxd/'
wget -q -O - $(shell echo $(LATEST_CLIENT) | awk '{printf $$1}') | tar -zxv ./influx --transform 's/\.\/influx/bin\/influxc/'
.PHONY: ems
ems: influxdb ems-build
.PHONY: ems-build
ems-build:
docker build --no-cache \
--file Dockerfile \
--target aio \
--tag pi-wegrzyn/ems:$(VERSION) \
--tag pi-wegrzyn/ems:latest \
--build-arg CONFIG=./testdata/ems.yaml .
.PHONY: ems-cached
ems-build-cached:
docker build \
--file Dockerfile \
--target aio \
--tag pi-wegrzyn/ems:$(VERSION) \
--tag pi-wegrzyn/ems:latest \
--build-arg CONFIG=./testdata/ems.yaml .
.PHONY: generator
generator:
go build -C generator -o ../bin/eeprom-generator -ldflags "-X main.version=$(VERSION)"
.PHONY: presenter
presenter:
docker build --no-cache \
--file presenter/Dockerfile \
--tag pi-wegrzyn/ep:$(VERSION) \
--tag pi-wegrzyn/ep:latest \
--build-arg EEPROM_ITER=300 \
--build-arg SLEEP_TIME=1 \
--build-arg EEPROM_SRC=bin/eeprom/ .
.PHONY: sample-presenter
sample-presenter: generator sample-eeprom-files presenter
.PHONY: sample-eeprom-files
sample-eeprom-files:
./bin/eeprom-generator -c ./testdata/generator.yaml -o ./bin/eeprom
.PHONY: clean
clean:
rm -rf bin/*