-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
137 lines (105 loc) · 4.01 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
BUILD_TARGETS = base-centos-6 \
base-centos-7 \
base-centos-8-kvm \
base-64-es \
base-lx-debian-9 \
esdc-mon \
esdc-mgmt \
esdc-cfgdb \
esdc-dns \
esdc-img \
esdc-node \
network-access-zone \
contrib-centos-6 \
contrib-centos-7 \
contrib-centos-8-kvm \
contrib-gitlab-ce \
contrib-centos-7-desktop \
contrib-odoo \
contrib-opnsense \
contrib-ubuntu-focal \
contrib-ubuntu-jammy \
contrib-ubuntu-noble
define newline
endef
comma:= ,
empty:=
space:= ${empty} $(empty)
reverse_clean = $(if $(1),$(call reverse_clean,$(wordlist 2,$(words $(1)),$(1)))) $(if $(1),$(firstword clean-$(1)))
build_targets = $(subst $(space),$(newline)$(space)$(space)$(space)$(space),$(BUILD_TARGETS))
clean_targets = $(call reverse_clean,$(BUILD_TARGETS))
define HELP_TEXT
**** Danube Cloud Assembly Line ****
Please use 'make <target>' where <target> is one of:
init initialize the builder directory structure
check examine the builder directory structure and HTTP access
archive-<pkg> build a tarball for the hypervisor, one of:
local /opt/local on the hypervisor
monitoring /opt/zabbix on the hypervisor
opt-custom /opt/custom on the hypervisor
esdc-node /opt/erigones on the hypervior
archives download hypervisor OS archives
isos download iso images
platform download hypervisor platform archive
usb-deps download archives, isos and platform
usb-image build USB image
imgapi-tree rebuild the IMGAPI tree
clean delete all appliance VMs and their base images in reverse order
clean-<app> delete appliance VM and its base image
all build all appliances/images
base build all base appliances (base-centos-6 base-centos-7 base-64-es)
esdc build all Danube Cloud appliances (esdc-mon, esdc-mgmt, esdc-cfgdb, esdc-dns, esdc-img, esdc-node)
<app> build an appliance/image, one of:
$(build_targets)
NOTE: The build order is rather important.
Following environment variables will change the build behaviour:
VERSION build a specific version of an appliance (default: current YYYYMMDD)
VERBOSE make ansible more verbose
EXTRA_VARS override ansible variables, e.g.:
- usb_type={hn,cn} (default: hn)
- release_edition={ce,ee} (default: ce)
- esdc_source_repo=\"https://github.com/erigones/esdc-ce.git\"
- esdc_prod_repo=\"\"
- image_debug={false,true} (default: false)
EXAMPLES:
gmake esdc-mon
env EXTRA_VARS=\"builder_platform_url=\'http://smartos-builder/output\'\" gmake platform
env VERSION=\"v4.0-beta2\" EXTRA_VARS=\"software_branch=master\" gmake esdc-mgmt
env VERSION=\"v4.0-rc1\" gmake esdc-mgmt
env VERSION=\"v4.0\" gmake archive-monitoring
env VERSION=\"v4.0\" EXTRA_VARS=\"appliance_name=esdc-dns src_version=latest\" gmake vm-optlocal
env VERSION=\"v4.0\" EXTRA_VARS=\"usb_type=hn\" gmake usb-image
env VERSION=\"v4.0\" EXTRA_VARS=\"usb_type=cn\" gmake usb-image
endef
.PHONY: help init check clean imgapi-tree all $(BUILD_TARGETS) $(clean_targets)
help:
@printf "$(subst $(newline),\n,${HELP_TEXT})"
init:
@bin/ansible.sh init
check:
@bin/ansible.sh check
imgapi imgapi-tree:
@bin/ansible.sh imgapi-tree
archives platform isos:
@bin/ansible.sh get-$@
usb-deps: archives platform isos
usb usb-image:
@bin/ansible.sh build-usb-image
$(clean_targets) clean-tmp:
@bin/ansible.sh $@
clean: $(clean_targets) clean-tmp
$(BUILD_TARGETS):
@bin/ansible.sh build-$@
all: $(BUILD_TARGETS)
base: base-centos-6 base-centos-7 base-64-es
esdc: esdc-mon esdc-mgmt esdc-cfgdb esdc-dns esdc-img esdc-node
archive-local local-archive:
@bin/ansible.sh build-archive-local
archive-monitoring monitoring-archive:
@bin/ansible.sh build-archive-monitoring
archive-opt-custom opt-custom-archive:
@bin/ansible.sh build-archive-opt-custom
archive-esdc-node esdc-node-archive:
@bin/ansible.sh build-archive-esdc-node
vm-optlocal vm-optlocal-archive:
@bin/ansible.sh build-vm-optlocal