-
Notifications
You must be signed in to change notification settings - Fork 168
/
Copy pathdo_vagrant_cbs.sh
executable file
·68 lines (59 loc) · 1.53 KB
/
do_vagrant_cbs.sh
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
#!/bin/sh
# To see all options in koji -p command check "koji -p cbs image-build --help"
set -eu
usage()
{
cat << EOF
usage: $(basename $0) <argument>
where <argument> is one of:
6 -- build Vagrant images for CentOS 6
7 -- build Vagrant images for CentOS 7
all -- build Vagrant images for both CentOS 6 and 7
EOF
exit 1
}
build_vagrant_image()
{
# The kickstart files are in the same directory as this script
KS_DIR=$(dirname $0)
# Always wait if stdout is not a tty (needed by ci.centos.org)
if [ ! -t 1 ]; then WAIT="--wait"; fi
EL_MAJOR=$1
koji -p cbs image-build \
centos-${EL_MAJOR} 1 cloudinstance${EL_MAJOR}-common-el${EL_MAJOR} \
http://mirror.centos.org/centos/${EL_MAJOR}/os/x86_64/ x86_64 \
--release=1 \
--distro RHEL-${EL_MAJOR}.0 \
--ksver RHEL${EL_MAJOR} \
--kickstart=${KS_DIR}/centos${EL_MAJOR}.ks \
--format=vagrant-libvirt \
--format=vagrant-virtualbox \
--format=vagrant-vmware-fusion \
--format=vagrant-hyperv \
--factory-parameter fusion_scsi_controller_type pvscsi \
--ova-option vagrant_sync_directory=/vagrant \
--repo http://mirror.centos.org/centos/${EL_MAJOR}/extras/x86_64/\
--repo http://mirror.centos.org/centos/${EL_MAJOR}/updates/x86_64/\
--scratch \
${WAIT:-"--nowait"} \
--disk-size=40
}
if [ $# -ne 1 ]; then
usage
fi
case $1 in
6)
build_vagrant_image 6
;;
7)
build_vagrant_image 7
;;
all)
build_vagrant_image 6
build_vagrant_image 7
;;
*)
usage
;;
esac
# vim: set sw=2: