generated from ibm-developer-skills-network/coding-project-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
58 lines (45 loc) · 1.51 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
.PHONY: all help install build run
help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-\\.]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
all: help
.PHONY: build
build: ## Build a Docker image
$(info Building Docker image...)
docker build --rm --pull --tag products:1.0 .
install: ## Install Java dependencies
$(info Installing dependencies...)
./mvnw dependency:resolve
lint: ## Run the linter
$(info Running linting...)
./mvnw checkstyle:check
.PHONY: tests
tests: ## Run the unit tests
$(info Running tests...)
./mvnw test
.PHONY: integration-tests
integration-tests: ## Run integration tests
$(info Running integration tests...)
./mvnw verify -P integration-test
run: ## Run the service
$(info Starting service...)
./mvnw spring-boot:run
dbrm: ## Stop and remove PostgreSQL in Docker
$(info Stopping and removing PostgreSQL...)
-docker stop postgres
-docker rm postgres
db: ## Run PostgreSQL in Docker
$(info Running PostgreSQL...)
docker run -d --name postgres \
-p 5432:5432 \
-e POSTGRES_PASSWORD=postgres \
-v postgres:/var/lib/postgresql/data \
postgres:alpine
clean: ## Clean the project
$(info Cleaning the project...)
./mvnw clean
package: ## Package the application
$(info Packaging the application...)
./mvnw package
cucumber: ## Run Cucumber BDD tests
$(info Running Cucumber tests...)
./mvnw test -Dtest=CucumberTestRunner