-
Notifications
You must be signed in to change notification settings - Fork 27
/
Makefile
108 lines (82 loc) · 3.48 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
TF_DE_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
TF_DE_TOP := $(abspath $(TF_DE_DIR)/../)/
SHELL=/bin/bash -o pipefail
# include RPM-building targets
-include $(TF_DE_TOP)contrail/tools/packages/Makefile
REPODIR=$(TF_DE_TOP)contrail
CONTAINER_BUILDER_DIR=$(REPODIR)/contrail-container-builder
CONTRAIL_TEST_DIR=$(REPODIR)/third_party/contrail-test
export REPODIR
export CONTRAIL_TEST_DIR
export CONTAINER_BUILDER_DIR
all: dep rpm containers
fetch_packages:
@$(TF_DE_DIR)scripts/fetch-packages.sh
setup:
@yum autoremove -y python2-requests python2-urllib3
@python2 -m pip list | grep urllib3 >/dev/null && python2 -m pip uninstall -y urllib3 requests chardet || true
@python2 -m pip -q uninstall -y setuptools || true
@yum -q reinstall -y python2-setuptools
@yum -q install -y python2-requests python2-urllib3
sync:
@$(TF_DE_DIR)scripts/sync-sources.sh
##############################################################################
# RPM repo targets
create-repo:
@mkdir -p $(REPODIR)/RPMS
@createrepo --update $(REPODIR)/RPMS/
@echo "INFO: clean all for contrail repo after udpate"
@yum clean all --disablerepo=* --enablerepo=contrail || true
update-repo: create-repo
clean-repo:
@test -d $(REPODIR)/RPMS/repodata && rm -rf $(REPODIR)/RPMS/repodata || true
setup-httpd:
@$(TF_DE_DIR)scripts/setup-httpd.sh
##############################################################################
# Contrail third party packaged
build-tpp:
@$(TF_DE_DIR)scripts/build-tpp.sh
package-tpp:
@$(TF_DE_DIR)scripts/package-tpp.sh
##############################################################################
# Container deployer-src targets
src-containers:
@$(TF_DE_DIR)scripts/package/build-src-containers.sh |& sed "s/^/src-containers: /"
##############################################################################
# Container builder targets
prepare-containers:
@$(TF_DE_DIR)scripts/package/prepare-containers.sh |& sed "s/^/containers: /"
list-containers:
@$(TF_DE_DIR)scripts/package/list-containers.sh $(CONTAINER_BUILDER_DIR) container
container-%:
@$(TF_DE_DIR)scripts/package/build-containers.sh $(CONTAINER_BUILDER_DIR) container $(patsubst container-%,%,$(subst _,/,$(@))) | sed "s/^/$(@): /"
containers-only:
@$(TF_DE_DIR)scripts/package/build-containers.sh $(CONTAINER_BUILDER_DIR) container |& sed "s/^/containers: /"
containers: prepare-containers containers-only
##############################################################################
# Operator container targets
operator-containers:
@$(TF_DE_DIR)scripts/package/build-operator-containers.sh |& sed "s/^/operator-containers: /"
##############################################################################
# Test container targets
test-containers:
@$(TF_DE_DIR)scripts/package/build-test-containers.sh |& sed "s/^/test-containers: /"
##############################################################################
# Unit Test targets
test:
@$(TF_DE_DIR)scripts/run-tests.sh $(TEST_PACKAGE)
##############################################################################
# Prepare Doxygen documentation
doxygen:
echo $(DOXYFILE)
doxygen $(DOXYFILE)
##############################################################################
# Other clean targets
clean-rpm:
@test -d $(REPODIR)/RPMS && rm -rf $(REPODIR)/RPMS/* || true
clean: clean-deployers clean-containers clean-repo clean-rpm
@true
dbg:
@echo $(TF_DE_TOP)
@echo $(TF_DE_DIR)
.PHONY: clean-deployers clean-containers clean-repo clean-rpm setup build containers deployers createrepo all