[#75] Add make targets policy and docker/%

Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
Anton Nikiforov 2023-05-30 15:48:19 +03:00 committed by Evgenii Stratonikov
parent 406c2324d4
commit e6b662cfa6
2 changed files with 19 additions and 0 deletions

4
Dockerfile Normal file
View file

@ -0,0 +1,4 @@
FROM golang:1.19
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install make openjdk-11-jre -y
WORKDIR /work

View file

@ -1,5 +1,7 @@
#!/usr/bin/make -f
ANTLR_VERSION="4.13.0"
# Run tests
test:
@go test ./... -cover
@ -29,6 +31,19 @@ format:
@echo "⇒ Processing goimports check"
@goimports -w ./
policy:
@wget -q https://www.antlr.org/download/antlr-${ANTLR_VERSION}-complete.jar -O antlr4-tool.jar
@java -Xmx500M -cp "`pwd`/antlr4-tool.jar" "org.antlr.v4.Tool" -o `pwd`/netmap/parser/ -Dlanguage=Go -no-listener -visitor `pwd`/netmap/parser/Query.g4 `pwd`/netmap/parser/QueryLexer.g4
# Run `make %` in truecloudlab/frostfs-sdk-go container(Golang+Java)
docker/%:
@docker build -t truecloudlab/frostfs-sdk-go --platform linux/amd64 . > /dev/null
@docker run --rm -t \
-v `pwd`:/work \
-u "$$(id -u):$$(id -g)" \
--env HOME=/work \
truecloudlab/frostfs-sdk-go make $*
# Show this help prompt
help:
@echo ' Usage:'