-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (42 loc) · 1.02 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
.PHONY: help build test image clean
.DEFAULT_GOAL := help
APP_NAME := setup-custom-action-by-ts
# Init the venv
init:
@pnpm i
# Build wheel
build:
@pnpm build
# Test
test:
@pnpm test
# Build image
image:
@docker image build -t $(APP_NAME) .
# Start a compose service
compose-up:
@docker compose -f ./compose.yml -p $(APP_NAME) up -d
# Shutdown a compose service
compose-down:
@docker compose -f ./compose.yml down
# Clean build artifacts
clean:
@rm -rf build dist *.egg-info htmlcov .coverage coverage.xml coverage.lcov coverage
@docker compose -f ./compose.yml down -v
@docker image rm -f $(APP_NAME)
# Show help
help:
@echo ""
@echo "Usage:"
@echo " make [target]"
@echo ""
@echo "Targets:"
@awk '/^[a-zA-Z\-_0-9]+:/ \
{ \
helpMessage = match(lastLine, /^# (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")-1); \
helpMessage = substr(lastLine, RSTART + 2, RLENGTH); \
printf "\033[36m%-22s\033[0m %s\n", helpCommand,helpMessage; \
} \
} { lastLine = $$0 }' $(MAKEFILE_LIST)