-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
33 lines (27 loc) · 1.04 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
export WS_ROOT=$(shell pwd)
export PLUGIN=$(notdir $(CURDIR))
export CACHE =
define banner
@echo "========================================================================"
@echo " $(1)"
@echo "========================================================================"
@echo " "
endef
.PHONY: build
build:
docker build -t debug/${PLUGIN} . $(CACHE)
.PHONY: debug
debug: build
docker run -ti --name ${PLUGIN} -v ${WS_ROOT}:/opt debug/${PLUGIN}
.PHONY: test
test: build
docker run -d --name ${PLUGIN} -v ${WS_ROOT}:/opt debug/${PLUGIN}
docker exec ${PLUGIN} bash -c "export AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}; export AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}; cd /opt/test/api; spaceone test"
.PHONY: clean
clean:
docker rm -f ${PLUGIN}
help:
@echo "Make Targets:"
@echo " debug - build Plugin Docker Image and Run"
@echo " test - build Plugin Docker Image then Run UnitTest case"
@echo " clean - stop Plugin Docker"