forked from Juniper/contrail-dev-env
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
76 lines (53 loc) · 2.27 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
DE_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
DE_TOP := $(abspath $(DE_DIR)/../)/
# include RPM-building targets
-include $(DE_TOP)contrail/tools/packages/Makefile
repos_dir=$(DE_TOP)src/review.opencontrail.org/Juniper/
container_builder_dir=$(repos_dir)contrail-container-builder/
ansible_playbook=ansible-playbook -i inventory --extra-vars @vars.yaml --extra-vars @dev_config.yaml
all: dep rpm containers
list-containers: prepare-containers
@$(container_builder_dir)containers/build.sh list | grep -v INFO | sed -e 's,/,_,g' -e 's/^/container-/'
fetch_packages:
@cd $(DE_TOP)contrail/third_party && python -u fetch_packages.py 2>&1 | grep -Ei 'Processing|patching'
setup:
@pip list | grep urllib3 >/dev/null && pip uninstall -y urllib3 || true
@pip -q uninstall -y setuptools || true
@yum -q reinstall -y python-setuptools
container-%: prepare-containers createrepo
@$(container_builder_dir)containers/build.sh $(patsubst container-%,%,$(subst _,/,$(@)))
containers: create-repo prepare-containers
@$(container_builder_dir)containers/build.sh
deploy_contrail_kolla: containers
@$(ansible_playbook) $(repos_dir)contrail-project-config/playbooks/kolla/centos74-provision-kolla.yaml
deploy_contrail_k8s: containers
@$(ansible_playbook) $(repos_dir)contrail-project-config/playbooks/docker/centos74-systest-kubernetes.yaml
unittests ut: build
@echo "$@: not implemented"
sanity: deploy
@echo "$@: not implemented"
build deploy:
@echo "$@: not implemented"
# utility targets
sync:
@cd $(DE_TOP)contrail && repo sync -q --no-clone-bundle -j $(shell nproc)
$(container_builder_dir).git:
@$(DE_DIR)scripts/prepare-containers.sh
prepare-containers: $(container_builder_dir).git
create-repo:
@mkdir -p $(DE_TOP)contrail/RPMS
@createrepo -C $(DE_TOP)contrail/RPMS/
# Clean targets
clean-containers:
@test -d $(container_builder_dir) && rm -rf $(container_builder_dir) || true
clean-repo:
@test -d $(DE_TOP)contrail/RPMS/repodata && rm -rf $(DE_TOP)contrail/RPMS/repodata || true
clean-rpm:
@test -d $(DE_TOP)contrail/RPMS && rm -rf $(DE_TOP)contrail/RPMS/* || true
clean: clean-containers clean-repo clean-rpm
@true
dbg:
@echo $(DE_TOP)
@echo $(DE_DIR)
@echo $(SB_TOP)
.PHONY: clean-containers clean-repo clean-rpm setup build containers createrepo unittests ut sanity all