-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
47 lines (38 loc) · 1.06 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
TM_AM_LOG_LEVEL ?= debug
IMAGE_NAME := amaas/amaas-grpc-ts-client:latest
VERSION_LOCATION := './VERSION'
VERSION := $(shell cat $(VERSION_LOCATION))
# BSD sed does not support --version argument, use this to check if the sed is GNU or BSD one
ifeq ($(shell sed --version >/dev/null 2>&1; echo $$?),0)
SED := sed -i
else
SED := sed -i ''
endif
all: clean build
build:
docker build \
-t $(IMAGE_NAME) \
--build-arg PACK_CMD=pack \
--build-arg TM_AM_LOG_LEVEL=$(TM_AM_LOG_LEVEL) \
.
mkdir -p output
docker run --rm $(IMAGE_NAME) tar -cz file-security-sdk-$(VERSION).tgz | tar xzf - -C output
publish:
docker build \
-t $(IMAGE_NAME) \
--build-arg NPM_TOKEN=$(NODE_AUTH_TOKEN) \
--build-arg PACK_CMD=publish \
--build-arg TM_AM_LOG_LEVEL=$(TM_AM_LOG_LEVEL) \
.
test:
docker build \
--target unit_test \
-t $(IMAGE_NAME) \
--build-arg TM_AM_LOG_LEVEL=$(TM_AM_LOG_LEVEL) \
.
docker run --rm $(IMAGE_NAME) tar -cz coverage | tar xzf -
clean:
-@docker rmi -f $(IMAGE_NAME) || true
rm -rf output
rm -rf coverage
.PHONY: all build publish test clean