-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
43 lines (34 loc) · 1.11 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
.DEFAULT_GOAL := help
help: ## Autogenerated help reference for make
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: help
clean: ## Clean build directory
./gradlew clean
test: ## Run tests
./gradlew test
build: ## Build the executable jar for this project. Tests won't be run.
./gradlew build -x test
deploy-rest-api: build ## Deploy the REST API application in production mode (on port 8080)
nohup java -jar \
-Dspring.profiles.active=production \
-Xmx2048m \
rest-api/build/libs/rest-api.jar \
&
deploy-telegram-bot: build ## Run telegram bot in production mode
nohup java -jar \
-Dspring.profiles.active=production \
-Xmx1024m \
telegram-bot/build/libs/telegram-bot.jar \
&
@make pid MODULE=telegram-bot
logs: ## See logs of running application
@tail -f nohup.out -n 20
MODULE ?= "rest-api"
pid: ## Find PID of running application for kill
@ps aux \
| grep $(MODULE) \
| grep jar \
| grep java \
| grep -v grep \
|| echo "Application is not running"
.PHONY: all build test clean $(MAKECMDGOALS)