-
Notifications
You must be signed in to change notification settings - Fork 78
/
Copy pathgen-iso.sh
executable file
·51 lines (36 loc) · 1.63 KB
/
gen-iso.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
#!/bin/bash
set -ueE
usage()
{
echo "----------------------------------------------------------------------------------------"
echo "- The purpose of this script is to be executed inside the container of our development environment to generate ISO files for XCP-ng."
echo "- Usage: $0 <XCP-ng version> <REPOSITORY>"
echo "- All options are mandatory."
echo "- VERSION of XCP-ng: 8.2 or 8.3"
echo "- REPOSITORY: update, testing, ci, ..."
echo "- Example: $0 8.3 testing"
echo "----------------------------------------------------------------------------------------"
}
if [ $# -lt 2 ]; then
echo "Missing argument(s)"
echo
usage
exit 1
fi
VERSION="$1"
if [ "$VERSION" != "8.3" ] && [ "$VERSION" != "8.2" ]; then
echo "Unsupported version. Please choose between 8.2 and 8.3."
exit
fi
REPOSITORY="$2"
THEDATE=$(date +%Y%m%d)
set -x
NAMEIMG="install-${VERSION}-${REPOSITORY}.img"
NAMEISO="xcp-ng-${VERSION}-${REPOSITORY}-nightly-${THEDATE}.iso"
NAMEISONI="xcp-ng-${VERSION}-${REPOSITORY}-netinstall-nightly-${THEDATE}.iso"
MNTVOL="XCP-ng ${VERSION} ${REPOSITORY} ${THEDATE}"
sudo yum install -y genisoimage syslinux grub-tools createrepo_c libfaketime
cd /data
sudo ./scripts/create-installimg.sh --srcurl "https://updates.xcp-ng.org/8/${VERSION}" -o "${NAMEIMG}" "${VERSION}":"${REPOSITORY}"
./scripts/create-iso.sh --netinstall --srcurl "https://updates.xcp-ng.org/8/${VERSION}" -V "${MNTVOL}" -o "${NAMEISONI}" "${VERSION}":"${REPOSITORY}" "${NAMEIMG}"
./scripts/create-iso.sh --srcurl "https://updates.xcp-ng.org/8/${VERSION}" -V "${MNTVOL}" -o "${NAMEISO}" "${VERSION}":"${REPOSITORY}" "${NAMEIMG}"