gen-iso.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/bash
  2. set -ueE
  3. usage()
  4. {
  5. echo "----------------------------------------------------------------------------------------"
  6. echo "- The purpose of this script is to be executed inside the container of our development environment to generate ISO files for XCP-ng."
  7. echo "- Usage: $0 <XCP-ng version> <REPOSITORY>"
  8. echo "- All options are mandatory."
  9. echo "- VERSION of XCP-ng: 8.2 or 8.3"
  10. echo "- REPOSITORY: update, testing, ci, ..."
  11. echo "- Example: $0 8.3 testing"
  12. echo "----------------------------------------------------------------------------------------"
  13. }
  14. if [ $# -lt 2 ]; then
  15. echo "Missing argument(s)"
  16. echo
  17. usage
  18. exit 1
  19. fi
  20. VERSION="$1"
  21. if [ "$VERSION" != "8.3" ] && [ "$VERSION" != "8.2" ]; then
  22. echo "Unsupported version. Please choose between 8.2 and 8.3."
  23. exit
  24. fi
  25. REPOSITORY="$2"
  26. THEDATE=$(date +%Y%m%d)
  27. set -x
  28. NAMEIMG="install-${VERSION}-${REPOSITORY}.img"
  29. NAMEISO="xcp-ng-${VERSION}-${REPOSITORY}-nightly-${THEDATE}.iso"
  30. NAMEISONI="xcp-ng-${VERSION}-${REPOSITORY}-netinstall-nightly-${THEDATE}.iso"
  31. MNTVOL="XCP-ng ${VERSION} ${REPOSITORY} ${THEDATE}"
  32. sudo yum install -y genisoimage syslinux grub-tools createrepo_c libfaketime
  33. cd /data
  34. sudo ./scripts/create-installimg.sh --srcurl "https://updates.xcp-ng.org/8/${VERSION}" -o "${NAMEIMG}" "${VERSION}":"${REPOSITORY}"
  35. ./scripts/create-iso.sh --netinstall --srcurl "https://updates.xcp-ng.org/8/${VERSION}" -V "${MNTVOL}" -o "${NAMEISONI}" "${VERSION}":"${REPOSITORY}" "${NAMEIMG}"
  36. ./scripts/create-iso.sh --srcurl "https://updates.xcp-ng.org/8/${VERSION}" -V "${MNTVOL}" -o "${NAMEISO}" "${VERSION}":"${REPOSITORY}" "${NAMEIMG}"