-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (46 loc) · 1.89 KB
/
Copy pathMakefile
File metadata and controls
61 lines (46 loc) · 1.89 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.PHONY: help images test benchmark
.DEFAULT_GOAL:=help
include .env
include modules/.env
CENTOS_VERSION ?= 7.5.1804
VARNISH_VERSION ?= 6.0.1-1
IMAGE_OWNER ?= mondiamedia
MODULE ?=
FORCE ?=
images: ## Builds docker images (base, varnish-devel, varnish) for given env variable VARNISH_VERSION.
@echo "Building images..."
./build_images.sh
rpms: images ## Builds Varnish and modules RPMs for given env variable VARNISH_VERSION.
@echo "Building VMODS RPMs..."
./modules/build_vmods.sh
start: rpms ## Starts Varnish with modules RPMs in a simple Docker Compose stack together with some backend service.
@echo "Starting Varnish test environment..."
@./compose.sh "up -d"
stop: ## Stops the test stack without removing the images
@echo "Stopping Varnish test environment..."
@./compose.sh down
clean: ## Cleans up the Docker Compose test environment.
@echo "Purging Docker Compose setup..."
@./compose.sh "down --rmi local"
varnishlog: ## Opens the varnishlog console
@echo "Starting varnishlog..."
@./compose.sh "exec varnish varnishlog"
console: ## Opens the Varnish console
@echo "Starting Varnish console..."
@./compose.sh "exec varnish /bin/bash"
clean-rpms: ## Cleans up the RPM distribution directory.
@echo "Purging VMODS RPMs..."
rm -rf ./modules/dist
load: ## Performs a load test for Varnish.
@echo "Running load test..."
./benchmark.sh
benchmark: clean start load clean ## Ensures stack whether it is started, performs benchmark and cleans up the stack after.
@echo "Running benchmark..."
logs: ## Open docker compose log.
@echo "Running load test..."
@./compose.sh "logs -f"
help: ## Prints the help about targets.
@printf "Usage: make [\033[34mtarget\033[0m]\n"
@printf "Default: \033[34m%s\033[0m\n" $(.DEFAULT_GOAL)
@printf "Targets:\n"
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " \033[34m%-17s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort