-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
167 lines (129 loc) · 3.52 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
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
#
# Copyright (c) 2015 Midokura SARL, All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# __ __ _ _ _
# | \/ (_) __| | ___ _ __ ___| |_
# | |\/| | |/ _` |/ _ \| '_ \ / _ \ __|
# | | | | | (_| | (_) | | | | __/ |_
# |_| |_|_|\__,_|\___/|_| |_|\___|\__|
#
#
# Run Midonet Openstack on top of Ubuntu Docker ssh images.
#
all: start passwordcache preflight stage1 stage3 stage4 haproxy stage5 stage6 stage7 success finish
include include/orizuru.mk
PREREQUISITES = sshconfig zonefile etchosts
passwordcache:
test -f $(PASSWORDCACHE) || $(BINDIR)/mkpwcache.sh | tee $(PASSWORDCACHE)
preflight: pipinstalled pipdeps
#
# do not use this without running make preflight at least once!
#
ci:
bin/ci.sh
sshconfig:
mkdir -pv $(shell dirname $(SSHCONFIG))
$(FAB) > $(SSHCONFIG)
zonefile:
mkdir -pv $(shell dirname $(ZONEFILE))
cat $(ZONEFILE_TEMPLATE) > $(ZONEFILE)
$(FAB) >> $(ZONEFILE)
etchosts:
mkdir -pv $(shell dirname $(HOSTSFILE))
$(FAB) > $(HOSTSFILE).NEW
./stages/$@/bin/localips.sh >> $(HOSTSFILE).NEW
mv $(HOSTSFILE).NEW $(HOSTSFILE)
stage1: $(PREREQUISITES)
test -f "$(TMPDIR)/.SUCCESS_$(@)" || $(FAB)pingcheck
test -f "$(TMPDIR)/.SUCCESS_$(@)" || $(FAB)sshcheck
$(RUNSTAGE)
reboot: stage2
wifi:$(PREREQUISITES)
$(RUNSTAGE); rm $(TMPDIR)/.SUCCESS_$(@)
poweroff: $(PREREQUISITES)
$(RUNSTAGE); rm $(TMPDIR)/.SUCCESS_$(@)
rootlogins: $(PREREQUISITES)
$(RUNSTAGE); rm $(TMPDIR)/.SUCCESS_$(@)
disks: $(PREREQUISITES)
$(RUNSTAGE); rm $(TMPDIR)/.SUCCESS_$(@)
info: $(PREREQUISITES)
@clear
@$(FAB):admin_password="$(shell grep ADMIN_PASS $(PASSWORDCACHE) | awk -F'=' '{print $$2;}')"
@test -f $(TMPDIR)/.SUCCESS_stage1 || sleep 10
stage2: $(PREREQUISITES)
$(RUNSTAGE)
rm $(TMPDIR)/.SUCCESS_$(@)
stage3: $(PREREQUISITES)
mkdir -pv "$(TMPDIR)/etc/tinc"
$(RUNSTAGE)
stage4: $(PREREQUISITES)
$(RUNSTAGE)
haproxy: $(PREREQUISITES)
$(RUNSTAGE)
stage5: $(PREREQUISITES)
test -f "$(TMPDIR)/.SUCCESS_$(@)" || $(FAB)pingcheck
$(RUNSTAGE)
stage6: $(PREREQUISITES)
mkdir -pv $(TMPDIR)/img
cp img/favicon.ico $(TMPDIR)/img/favicon.ico
cp img/midokura.png $(TMPDIR)/img/midokura.png
$(RUNSTAGE)
stage7: $(PREREQUISITES)
$(RUNSTAGE)
#
# tempest
#
stage8: $(PREREQUISITES)
$(RUNSTAGE)
#
# swift
#
stage9: $(PREREQUISITES)
$(RUNSTAGE)
#
# vtep logic
#
stage10: $(PREREQUISITES)
$(RUNSTAGE)
#
# install gnome on all servers
#
stage11: $(PREREQUISITES)
$(RUNSTAGE)
uptime: $(PREREQUISITES)
$(RUNSTAGE)
rm $(TMPDIR)/.SUCCESS_$(@)
start:
mkdir -pv $(TMPDIR)
@date > $(TMPDIR)/.START
finish:
@date > $(TMPDIR)/.FINISH
success:
@echo
@echo your system is ready.
@echo
@echo run \'make info\' to see the urls and admin password
@echo
clean: $(PREREQUISITES) cleanlocks
test -n "$(TMPDIR)" && rm -rfv "$(TMPDIR)"/.SUCCESS_*
cleanlocks: $(PREREQUISITES)
$(FAB) || true
cleancontainerlocks: $(PREREQUISITES)
$(FAB) || true
distclean: $(PREREQUISITES) cleanup clean
test -n "$(TMPDIR)" && rm -rfv "$(TMPDIR)"
mkdir -pv "$(TMPDIR)"
find $(SRCDIR) -type f -path '*.pyc' -delete
make $(PREREQUISITES)