-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·30 lines (25 loc) · 1.15 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
# If you got podman installed, we're going to build with it!
PODMAN := $(shell command -v podman 2>/dev/null)
DOCKER := $(shell command -v docker 2>/dev/null)
ifeq ($(PODMAN), /usr/bin/podman)
CONTAINER_ENGINE := $(PODMAN)
else
CONTAINER_ENGINE := $(DOCKER)
endif
.PHONY: help
help: ## The default task is help.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
.DEFAULT_GOAL := help
build_image: help_deploy## Build the image
"$(CONTAINER_ENGINE)" build -f ./Dockerfile -t aliash_tool
"$(CONTAINER_ENGINE)" image prune --filter label=stage=aliash_tool_base_image
prune_baseimage: ## Remove the intermediate image
"$(CONTAINER_ENGINE)" image prune --filter label=stage=aliash_tool_base_image
run_test: ## Run aliash_tool for a help message after image build
"$(CONTAINER_ENGINE)" run aliash_tool
help_deploy: ## Build image and run tests in container
@echo "--------------------------------------------------------------------"
@echo "Usage:"
@echo "podman run \\"
@echo " aliash_tool <options> <commands> <options>"
@echo "--------------------------------------------------------------------"