forked from midonet/orizuru
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
171 lines (134 loc) · 3.69 KB
/
Makefile
File metadata and controls
171 lines (134 loc) · 3.69 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#
# 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 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
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)
@figlet UPGRADE SYSTEMS || true
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)
@figlet SET UP VPN || true
mkdir -pv "$(TMPDIR)/etc/tinc"
$(RUNSTAGE)
stage4: $(PREREQUISITES)
@figlet CONFIGURE CONTAINERS || true
$(RUNSTAGE)
stage5: $(PREREQUISITES)
@figlet UPGRADE CONTAINERS || true
test -f "$(TMPDIR)/.SUCCESS_$(@)" || $(FAB)pingcheck
$(RUNSTAGE)
stage6: $(PREREQUISITES)
@figlet INSTALL OPENSTACK || true
mkdir -pv $(TMPDIR)/img
cp img/favicon.ico $(TMPDIR)/img/favicon.ico
cp img/midokura.png $(TMPDIR)/img/midokura.png
$(RUNSTAGE)
stage7: $(PREREQUISITES)
@figlet INSTALL MIDONET || true
$(RUNSTAGE)
#
# tempest
#
stage8: $(PREREQUISITES)
@figlet TEMPEST || true
$(RUNSTAGE)
#
# swift
#
stage9: $(PREREQUISITES)
@figlet SWIFT || true
$(RUNSTAGE)
#
# vtep logic
#
stage10: $(PREREQUISITES)
@figlet VTEP || true
$(RUNSTAGE)
#
# install gnome on all servers
#
stage11: $(PREREQUISITES)
@figlet GNOME || true
$(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)