-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
44 lines (36 loc) · 852 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Variables
GRADLEW = gradlew.bat
BUILD_DIR = build
MAIN_CLASS = org.example.HuskSheetsRunner
DOCKER_IMAGE = husksheets-image
# Default target
.PHONY: all
all: create-build-dir build
# Use Gradle to build the project
.PHONY: build
build:
$(GRADLEW) build -x test
# Clean up build files using Gradle
.PHONY: clean
clean:
$(GRADLEW) clean
# Run the main class using Gradle
.PHONY: run
run:
$(GRADLEW) bootRun
# Run tests using Gradle
.PHONY: test
test:
$(GRADLEW) test
# Create build directory if it doesn't exist
.PHONY: create-build-dir
create-build-dir:
@if not exist $(BUILD_DIR) mkdir $(BUILD_DIR)
# Docker build
.PHONY: docker-build
docker-build: build
docker build -t $(DOCKER_IMAGE) .
# Docker run with command-line arguments
.PHONY: docker-run
docker-run:
docker run -e USERNAME=$(USERNAME) -e PASSWORD=$(PASSWORD) $(DOCKER_IMAGE)