-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
31 lines (24 loc) · 972 Bytes
/
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
JAVASRC = src pom.xml
COMPOSE = DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose
.PHONY: default
default: build
.PHONY: build
build: target
.PHONY: docker
docker: target/zebra4j
cp target/zebra4j docker/zebra4j
$(COMPOSE) build zebracli
target: $(JAVASRC)
./mvnw clean install
target/zebra4j: $(JAVASRC)
# Builds the image so that the user inside the container is the same as the calling user
# That way the container doesn't create files owned by root in the mounted volumes.
# Alternatively, both targets 'docker' and 'target/zebra4j' can be built completely in
# Docker as a multi-stage build - without running a container with volume. In that case,
# the Maven local repo will need to be mounted as cache -
# https://vsupalov.com/buildkit-cache-mount-dockerfile/.
UID=$(shell id -u) GID=$(shell id -g) $(COMPOSE) build native
$(COMPOSE) run --rm native ./mvnw install -P native
.PHONY: smoke_test
smoke_test:
$(COMPOSE) run --rm zebracli demo