-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
71 lines (59 loc) · 1.75 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
DOCKER_RUN = docker run -it --rm \
-e "http_proxy=$(http_proxy)" \
-e "https_proxy=$(https_proxy)" \
-e "HTTP_PROXY=$(HTTP_PROXY)" \
-e "HTTPS_PROXY=$(HTTPS_PROXY)" \
-v $(PWD):/usr/src
DOCKER_DAEMON = docker run -d \
-e "http_proxy=$(http_proxy)" \
-e "https_proxy=$(https_proxy)" \
-e "HTTP_PROXY=$(HTTP_PROXY)" \
-e "HTTPS_PROXY=$(HTTPS_PROXY)" \
-v $(PWD):/usr/src
all: docker-image reconf module dist package-deb
# build docker image
docker-image:
cd docker && make docker-image
# reconfigure sources
reconf:
$(DOCKER_RUN) libzbxpython/build-debian-jessie reconf
# compile library
module:
$(DOCKER_RUN) libzbxpython/build-debian-jessie make
# build distribution tarball
dist:
$(DOCKER_RUN) libzbxpython/build-debian-jessie make dist
package-deb:
$(DOCKER_RUN) libzbxpython/build-debian-jessie deb
# test agent keys with `zabbix_agentd -p`
test:
$(DOCKER_RUN) libzbxpython/build-debian-jessie test
# start a shell session in the docker container
shell:
$(DOCKER_RUN) libzbxpython/build-debian-jessie /bin/bash
# start the Zabbix agent
agent:
$(DOCKER_RUN) \
--name zabbix_agent \
-p 10050:10050 \
libzbxpython/build-debian-jessie agent
# start a shell session in the docker container with the Zabbix agent running
agent-shell:
docker rm -f zabbix_agent || :
$(DOCKER_DAEMON) \
--name zabbix_agent \
-p 10050:10050 \
libzbxpython/build-debian-jessie agent
sleep 2
docker exec -it zabbix_agent /bin/bash
docker rm -f zabbix_agent
# run a benchmark in the docker container with the Zabbix agent running
agent-bench:
docker rm -f zabbix_agent || :
$(DOCKER_DAEMON) \
--name zabbix_agent \
-p 10050:10050 \
libzbxpython/build-debian-jessie agent
sleep 2
docker exec -it zabbix_agent /entrypoint.sh bench
docker rm -f zabbix_agent