-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
63 lines (51 loc) · 1.43 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
B=\033[0;1m
G=\033[0;92m
R=\033[0m
NAME ?= homo
.PHONY: help attach auto up down deps
# Show this help prompt
help:
@echo ' Usage:'
@echo ''
@echo ' make <target>'
@echo ''
@echo ' Targets:'
@echo ''
@awk '/^#/{ comment = substr($$0,3) } comment && /^[a-zA-Z][a-zA-Z0-9_-]+ ?:/{ print " ", $$1, comment }' $(MAKEFILE_LIST) | column -t -s ':' | grep -v 'IGNORE' | sort | uniq
# Install dependencies
deps:
@go mod tidy -v
@go mod vendor
.golangci.yml:
wget -O $@ https://github.com/nspcc-dev/.github/raw/master/.golangci.yml
# Run linter
lint: .golangci.yml
@golangci-lint run
# Auto Tillich-Zémor hasher demo
auto: down deps
@echo "\n${B}${G}build container${R}\n"
@time docker build -t poc-demo .
@echo "\n${B}${G}Bootup container:${R}\n"
@time docker run -d --rm -it --name hash-demo poc-demo:latest sh
@bash ./auto.sh
@make down
# Stop demo container
down:
@echo "\n${B}${G}Stop container${R}\n"
@docker kill hash-demo || true
@docker rm -f hash-demo || true
# Run Tillich-Zémor hasher demo
up: down deps
@echo "\n${B}${G}build container${R}\n"
@time docker build -t poc-demo .
@echo "\n${B}${G}enter inside container:${R}\n"
@time docker run --rm -it --name hash-demo poc-demo:latest sh
# Attach to existing container
attach:
@echo "\n${B}${G} attach to hash-container ${R}\n"
@time docker exec -it --name hash-demo /bin/sh
# Test code with all backends
test:
go test ./...
test.generic:
go test ./... --tags=generic