forked from Ubuntu-Solutions-Engineering/openstack-installer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
144 lines (117 loc) · 4.46 KB
/
Makefile
File metadata and controls
144 lines (117 loc) · 4.46 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
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#
# Makefile for openstack-install
#
NAME = openstack
TOPDIR := $(shell basename `pwd`)
GIT_REV := $(shell git log --oneline -n1| cut -d" " -f1)
VERSION := $(shell ./tools/version)
UPSTREAM_DEB := https://github.com/Ubuntu-Solutions-Engineering/openstack-installer-deb.git
UPSTREAM_DEB_COMMIT := v0.99.27
UPSTREAM_MACUMBA := https://github.com/Ubuntu-Solutions-Engineering/macumba.git
UPSTREAM_MACUMBA_COMMIT := v0.7
UPSTREAM_MAASCLIENT := https://github.com/Ubuntu-Solutions-Engineering/maasclient.git
UPSTREAM_MAASCLIENT_COMMIT := 357db23
UPSTREAM_UBUNTUI := https://github.com/Ubuntu-Solutions-Engineering/urwid-ubuntu.git
UPSTREAM_UBUNTUI_COMMIT := v0.0.9
.PHONY: install-dependencies
install-dependencies:
sudo apt-get -yy install devscripts equivs pandoc
sudo mk-build-deps -i -t "apt-get --no-install-recommends -y" debian/control
.PHONY: uninstall-dependencies
uninstall-dependencies:
sudo apt-get remove openstack-build-deps
# sudo make uninstall type=single-system
# (or just sudo make uninstall)
.PHONY: uninstall
uninstall: uninstall-dependencies
sudo tools/openstack-uninstall ${type}
clean:
@-debian/rules clean
@rm -rf debian/cloud-install*
@rm -rf docs/_build/*
@rm -rf mockcfgpath
@rm -rf ../openstack_*.deb ../cloud-*.deb ../openstack_*.tar.gz ../openstack_*.dsc ../openstack_*.changes \
../openstack_*.build ../openstack-*.deb ../openstack_*.upload ../cloud-install-*.deb
@rm -rf cover
@rm -rf .coverage
@rm -rf .tox
DPKGBUILDARGS = -us -uc -i'.git.*|.tox|.bzr.*|.editorconfig|.travis-yaml|macumba\/debian|maasclient\/debian'
deb-src: clean update_version
@dpkg-buildpackage -S -sa $(DPKGBUILDARGS)
deb-release:
@dpkg-buildpackage -S -sd $(DPKGBUILDARGS)
deb: clean update_version man-pages
@dpkg-buildpackage -b $(DPKGBUILDARGS)
man-pages:
@pandoc -s docs/openstack-juju.rst -t man -o man/en/openstack-juju.1
@pandoc -s docs/openstack-status.rst -t man -o man/en/openstack-status.1
@pandoc -s docs/openstack-install.rst -t man -o man/en/openstack-install.1
@pandoc -s docs/openstack-uninstall.rst -t man -o man/en/openstack-uninstall.1
@pandoc -s docs/openstack-config.md -t man -o man/en/openstack-config.5
current_version:
@echo $(VERSION)
git-sync-requirements:
@echo Syncing git repos
@rm -rf tmp && mkdir -p tmp
@rm -rf debian
@rm -rf macumba
@rm -rf maasclient
@rm -rf ubuntui
git clone -q $(UPSTREAM_DEB) tmp/debian
git clone -q $(UPSTREAM_MACUMBA) tmp/macumba
git clone -q $(UPSTREAM_MAASCLIENT) tmp/maasclient
git clone -q $(UPSTREAM_UBUNTUI) tmp/ubuntui
@(cd tmp/debian && git checkout -q -f $(UPSTREAM_DEB_COMMIT))
@(cd tmp/maasclient && git checkout -q -f $(UPSTREAM_MAASCLIENT_COMMIT))
@(cd tmp/macumba && git checkout -q -f $(UPSTREAM_MACUMBA_COMMIT))
@(cd tmp/ubuntui && git checkout -q -f $(UPSTREAM_UBUNTUI_COMMIT))
@rsync -az -C --delete tmp/debian/debian .
@rsync -az -C --delete tmp/macumba/macumba .
@rsync -az -C --delete tmp/maasclient/maasclient .
@rsync -C -az --delete tmp/ubuntui/ubuntui .
@rm -rf tmp
git_rev:
@echo $(GIT_REV)
update_version: git-sync-requirements
wrap-and-sort
@sed -i -r "s/(^__version__\s=\s)(.*)/\1\"$(VERSION)\"/" cloudinstall/__init__.py
.PHONY: ci-test pyflakes pep8 test travis-test
ci-test: pyflakes pep8 travis-test
pyflakes:
python3 `which pyflakes` cloudinstall test bin
pep8:
pep8 cloudinstall test bin
$(HOME)/.cloud-install:
mkdir -p $(HOME)/.cloud-install
NOSE_ARGS = -v --with-cover --cover-package=cloudinstall --cover-html test --cover-inclusive cloudinstall
test: $(HOME)/.cloud-install tox
travis-test: $(HOME)/.cloud-install
nosetests $(NOSE_ARGS)
tox: $(HOME)/.cloud-install
@tox
status:
PYTHONPATH=$(shell pwd):$(PYTHONPATH) bin/openstack-status
# Indirection to allow 'make run' to build deb automatically, but
# 'make sbuild; make run' will not invoke 'deb'.
../openstack*.deb: deb
echo "rule to make .deb automatically"
.PHONY: install
install: ../openstack*.deb
-dpkg -i ../openstack_*deb
-dpkg -i ../openstack-${type}*deb
apt-get -yy install -f
# sudo make run type=multi proxy=http://localhost:3128/
.PHONY: run
run: install
MAAS_HTTP_PROXY=${proxy} openstack-install
# sudo make landscape
.PHONY: landscape
landscape: ../openstack*.deb
-dpkg -i ../openstack*deb
-dpkg -i ../openstack-multi*deb
-dpkg -i ../openstack-landscape*deb
apt-get -yy install -f
@echo please follow the instructions in
@echo "/usr/share/openstack/templates/landscape-deployments.yaml"
@echo and then run `sudo openstack-install` as usual
all: deb