-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathMakefile
76 lines (62 loc) · 2.32 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
72
73
74
75
76
include build-linux/make_common.env
export $(shell sed 's/=.*//' build-linux/make_common.env)
.PHONY: build
build: ubuntu centos
.PHONY: ubuntu
ubuntu: target/deb target/tmp/GPG-KEY-pagerduty
.PHONY: centos
centos: target/rpm target/tmp/GPG-KEY-RPM-pagerduty
.PHONY: build-ubuntu
build-ubuntu:
docker build . \
-t pdagent-integrations-ubuntu \
-f Dockerfile-ubuntu \
--build-arg FPM_VERSION="${FPM_VERSION}" \
--build-arg PYTHON_VERSION="${PYTHON_VERSION}" \
--build-arg UBUNTU_VERSION="${UBUNTU_VERSION}" \
--build-arg DOCKER_WORKDIR="${DOCKER_WORKDIR}"
.PHONY: build-centos
build-centos:
docker build . \
-t pdagent-integrations-centos \
-f Dockerfile-centos-7 \
--build-arg FPM_VERSION="${FPM_VERSION}" \
--build-arg PYTHON_VERSION="${PYTHON_VERSION}" \
--build-arg CENTOS_VERSION="${CENTOS_VERSION}" \
--build-arg DOCKER_WORKDIR="${DOCKER_WORKDIR}"
target/deb: build-ubuntu
docker run \
-v `pwd`:${DOCKER_WORKDIR} \
-it pdagent-integrations-ubuntu \
/bin/sh -c "/bin/sh build-linux/make_deb.sh ${DOCKER_WORKDIR}/build-linux/gpg-deb ${DOCKER_WORKDIR}/target"
target/rpm: build-centos
docker run \
-v `pwd`:${DOCKER_WORKDIR} \
-it pdagent-integrations-centos \
/bin/sh -c "/bin/sh build-linux/make_rpm.sh ${DOCKER_WORKDIR}/build-linux/gpg-rpm ${DOCKER_WORKDIR}/target"
target/tmp/GPG-KEY-pagerduty:
docker run \
-v `pwd`:${DOCKER_WORKDIR} \
-it pdagent-integrations-ubuntu \
/bin/sh -c "mkdir -p ${DOCKER_WORKDIR}/target/tmp; gpg --armor --export --homedir ${DOCKER_WORKDIR}/build-linux/gpg-deb > ${DOCKER_WORKDIR}/target/tmp/GPG-KEY-pagerduty"
target/tmp/GPG-KEY-RPM-pagerduty:
docker run \
-v `pwd`:${DOCKER_WORKDIR} \
-it pdagent-integrations-ubuntu \
/bin/sh -c "mkdir -p ${DOCKER_WORKDIR}/target/tmp; gpg --armor --export --homedir ${DOCKER_WORKDIR}/build-linux/gpg-rpm > ${DOCKER_WORKDIR}/target/tmp/GPG-KEY-RPM-pagerduty"
.PHONY: test
test:
find unit_tests -name "test_*.py" | xargs python run-tests.py
.PHONY: test-integration
test-integration: test-integration-ubuntu test-integration-centos
.PHONY: test-integration-ubuntu
test-integration-ubuntu: ubuntu
scripts/full-integration-test.sh ubuntu
.PHONY: test-integration-centos
test-integration-centos: centos
scripts/full-integration-test.sh centos
.PHONY: clean
clean:
rm -rf dist
rm -rf target
rm unit_tests/test_filelock_lock.txt