-
Notifications
You must be signed in to change notification settings - Fork 2
/
build
executable file
·158 lines (142 loc) · 3.4 KB
/
build
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
#!/usr/bin/bash
SYSTEM=$1
EXTRA_PKR_VARS=$2
PACKER_LOG=0
function cleanup() {
rm -rf *.box
}
# Oracle Linux Setup
function setup_build_ol610() {
export PKR_HCL_FILE=ol.pkr.hcl
export PKR_VARS=(
-var="box_tag=rhel-conversions/oracle-linux-6.10-uefi"
-var="version=6.10"
$EXTRA_PKR_VARS
)
export PKR_ONLY=-only="qemu.oraclelinux-610-uefi"
}
function setup_build_ol79() {
export PKR_HCL_FILE=ol.pkr.hcl
export PKR_VARS=(
-var="box_tag=rhel-conversions/oracle-linux-7.9-uefi"
-var="version=7.9"
$EXTRA_PKR_VARS
)
export PKR_ONLY=-only="qemu.oraclelinux-79-uefi"
}
function setup_build_ol84() {
export PKR_HCL_FILE=ol.pkr.hcl
export PKR_VARS=(
-var="box_tag=rhel-conversions/oracle-linux-8.4-uefi"
-var="version=8.4"
$EXTRA_PKR_VARS
)
export PKR_ONLY=-only="qemu.oraclelinux-84-uefi"
}
function setup_build_ol86() {
export PKR_HCL_FILE=ol.pkr.hcl
export PKR_VARS=(
-var="box_tag=rhel-conversions/oracle-linux-8.6-uefi"
-var="version=8.6"
$EXTRA_PKR_VARS
)
export PKR_ONLY=-only="qemu.oraclelinux-86-uefi"
}
function setup_build_ol87() {
export PKR_HCL_FILE=ol.pkr.hcl
export PKR_VARS=(
-var="box_tag=rhel-conversions/oracle-linux-8.7-uefi"
-var="version=8.7"
$EXTRA_PKR_VARS
)
export PKR_ONLY=-only="qemu.oraclelinux-87-uefi"
}
function setup_build_ol90() {
export PKR_HCL_FILE=ol.pkr.hcl
export PKR_VARS=(
-var="box_tag=rhel-conversions/oracle-linux-9.0-uefi"
-var="version=9.0"
$EXTRA_PKR_VARS
)
export PKR_ONLY=-only="qemu.oraclelinux-90-uefi"
}
# CentOS Linux Setup
function setup_build_centos79() {
export PKR_HCL_FILE=centos.pkr.hcl
export PKR_VARS=(
-var="box_tag=rhel-conversions/centos-7.9-uefi"
-var="version=7.9.2009.1"
$EXTRA_PKR_VARS
)
export PKR_ONLY=-only="qemu.centos-79-uefi"
}
function setup_build_centos84() {
export PKR_HCL_FILE=centos.pkr.hcl
export PKR_VARS=(
-var="box_tag=rhel-conversions/centos-8.4-uefi"
-var="version=8.4.2105"
$EXTRA_PKR_VARS
)
export PKR_ONLY=-only="qemu.centos-84-uefi"
}
function setup_build_centos85() {
export PKR_HCL_FILE=centos.pkr.hcl
export PKR_VARS=(
-var="box_tag=rhel-conversions/centos-8.5-uefi"
-var="version=8.5.2111"
$EXTRA_PKR_VARS
)
export PKR_ONLY=-only="qemu.centos-85-uefi"
}
function build() {
echo "Building $PKR_HCL_FILE"
PACKER_LOG=1 packer build "${PKR_VARS[@]}" "$PKR_ONLY" "$PKR_HCL_FILE"
}
case $SYSTEM in
centos)
setup_build_centos79
setup_build_centos84
setup_build_centos85
;;
centos79)
setup_build_centos79
;;
centos84)
setup_build_centos84
;;
centos85)
setup_build_centos85
;;
oracle_linux)
setup_build_ol610
setup_build_ol79
setup_build_ol84
setup_build_ol86
setup_build_ol87
setup_build_ol90
;;
ol610)
setup_build_ol610
;;
ol79)
setup_build_ol79
;;
ol84)
setup_build_ol84
;;
ol86)
setup_build_ol86
;;
ol87)
setup_build_ol87
;;
ol90)
setup_build_ol90
;;
*)
echo "Not an viable option."
exit 1
;;
esac
cleanup
build