forked from ContainX/openstack4j
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
24 lines (16 loc) · 636 Bytes
/
Makefile
File metadata and controls
24 lines (16 loc) · 636 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Make file used to build and test within Docker for prestine environment (Maven) tests
# Creates a Docker image locally in the format of "openstack4j-dev" with a tag of the current branch when make is executed
.PHONY: all test
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
IMAGE_NAME := openstack4j-dev$(if $(GIT_BRANCH),:$(GIT_BRANCH))
DOCKER_RUN := docker run --rm -it --privileged $(IMAGE_NAME)
default: build
all: compile test
compile: build
$(DOCKER_RUN) mvn clean compile
test: build
$(DOCKER_RUN) mvn verify
package: build
$(DOCKER_RUN) mvn clean package
build:
docker build -t "$(IMAGE_NAME)" .