-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (30 loc) · 964 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
.PHONY: build war image tasks
.ONESHELL:
SHELL = /bin/bash
.SHELLFLAGS = -e
PWD=$(shell pwd)
HELPER_IMAGE="local/gradle-node"
build: create ## Run gradle build inside container
@docker run --rm -u gradle \
-v gradle-cache:/home/gradle/.gradle \
-v $(PWD):/home/gradle/project \
-w /home/gradle/project \
$(HELPER_IMAGE) gradle build
war: build ## Create war file
@docker run --rm -u gradle \
-v gradle-cache:/home/gradle/.gradle \
-v $(PWD):/home/gradle/project \
-w /home/gradle/project \
$(HELPER_IMAGE) gradle war
create: ## create helper image
@docker volume create --name gradle-cache
@docker build -t $(HELPER_IMAGE) image
cleanup: ## delete cache-volume and local image
@docker volume rm gradle-cache
@docker rmi $(HELPER_IMAGE)
tasks: ## pass task into container
@docker run --rm -u gradle \
-v gradle-cache:/home/gradle/.gradle \
-v $(PWD):/home/gradle/project \
-w /home/gradle/project \
$(HELPER_IMAGE) gradle tasks