-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (28 loc) · 1.28 KB
/
Makefile
File metadata and controls
40 lines (28 loc) · 1.28 KB
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
# General release info
APP_NAME = httpdump-scratch
DOCKER_ACCOUNT = boeboe
VERSION = 1.0.0
# HELP
# This will output the help for each task
# thanks to https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
.PHONY: help
help: ## This help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
.DEFAULT_GOAL := help
#### DOCKER TASKS ###
build: ## Build the container
docker build ${DOCKER_BUILD_ARGS} -t $(DOCKER_ACCOUNT)/$(APP_NAME) --build-arg VERSION=${VERSION} .
build-nc: ## Build the container without caching
docker build ${DOCKER_BUILD_ARGS} --no-cache -t $(DOCKER_ACCOUNT)/$(APP_NAME) --build-arg VERSION=${VERSION} .
run: ## Run container
docker run --name="$(APP_NAME)" $(DOCKER_ACCOUNT)/$(APP_NAME)
up: build run ## Build and run container on port configured
stop: ## Stop and remove a running container
docker stop $(APP_NAME) || true
docker rm $(APP_NAME) || true
release: build-nc publish ## Make a full release
publish: ## Tag and publish container
@echo 'create tag $(VERSION)'
docker tag $(DOCKER_ACCOUNT)/$(APP_NAME) $(DOCKER_ACCOUNT)/$(APP_NAME):$(VERSION)
@echo 'publish $(VERSION) to $(DOCKER_ACCOUNT)/$(APP_NAME):$(VERSION)'
docker push $(DOCKER_ACCOUNT)/$(APP_NAME):$(VERSION)