diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 8ff2869a9c6..a89ddc1904d 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -150,12 +150,12 @@ Local development workflow ^^^^^^^^^^^^^^^^^^^^^^^^^^ This workflow makes it possible to test changes to the Anaconda source code locally on your machine without any dependencies -on external infrastructure. It uses two scripts, one called ``scripts/rebuild_boot_iso`` to build a fresh bootable installation image (boot.iso) -from Anaconda source code on the given branch and corresponding Fedora/CentOS Stream packages. The second script, called ``scripts/update_boot_iso`` +on external infrastructure. It uses two scripts, one called ``scripts/testing/rebuild_iso`` to build a fresh bootable installation image +from Anaconda source code on the given branch and corresponding Fedora/CentOS Stream packages. The second script, called ``scripts/testing/update_iso`` uses the Anaconda updates image mechanism together with the ``mkksiso`` command provided by the Lorax project to very quickly create an updated version of the boot.iso when Anaconda code is changed. The updated boot.iso can then be booted on a VM or bare metal. -The ``rebuild_boot_iso`` script +The ``rebuild_iso`` script """"""""""""""""""""""""""""""" This is just a simple script that rebuilds the boot.iso from Anaconda source code on the current branch & corresponding Fedora @@ -164,7 +164,9 @@ and also records Anaconda Git revision that was used to build the image. This should take about 15 minutes on modern hardware. -The ``update_boot_iso`` script +See --help for further information. + +The ``update_iso`` script """""""""""""""""""""""""""""" This is the main script that enables local development by quickly updating a boot iso with local changes. @@ -172,9 +174,9 @@ This should take a couple seconds on modern hardware. For the most common use case ("I have changed the Anaconda source and want to see what it does.") just do this: -1. run ``scripts/rebuild_boot_iso`` first, this creates ``result/iso/boot.iso`` +1. run ``scripts/testing/rebuild_iso`` first, this creates ``result/iso/boot.iso`` 2. change the Anaconda source code -3. run ``scripts/update_boot_iso`` which creates the ``result/iso/updated_boot.iso`` +3. run ``scripts/testing/update_iso`` which creates the ``result/iso/updated_boot.iso`` 4. start the ``result/iso/updated_boot.iso`` in a VM or on bare metal The script also has a few command line options that might come handy: diff --git a/scripts/rebuild_boot_iso b/scripts/rebuild_boot_iso deleted file mode 100755 index 6f4454e832b..00000000000 --- a/scripts/rebuild_boot_iso +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# -# rebuild_boot_iso -# -# This script is used to cleanly rebuild boot.iso from the current -# checked out branch. -# -# ask for sudo now, so we have it when we get to the image build -sudo echo "warming up sudo!" -BOOT_ISO="result/iso/boot.iso" -UPDATED_BOOT_ISO="result/iso/boot.iso.git_rev" -BOOT_ISO_GIT_REVISION="result/iso/boot.iso.git_rev" -# remove any previous package and relevant iso artifacts -rm -rf result/build/ -rm -f ${BOOT_ISO} -rm -f ${UPDATED_BOOT_ISO} -rm -f ${BOOT_ISO_GIT_REVISION} -# make sure the iso folder actually exists -mkdir -p result/iso/ -# note the Git revision from which we build the boot.iso -git rev-parse HEAD > result/iso/boot.iso.git_rev -make -f ./Makefile.am container-rpms-scratch -make -f ./Makefile.am anaconda-iso-creator-build -make -f ./Makefile.am container-iso-build diff --git a/scripts/testing/rebuild_iso b/scripts/testing/rebuild_iso new file mode 100755 index 00000000000..6bd8aa6de77 --- /dev/null +++ b/scripts/testing/rebuild_iso @@ -0,0 +1,80 @@ +#!/bin/bash +# +# rebuild_boot_iso +# +# This script is used to cleanly rebuild boot.iso from the current +# checked out branch. +# +# ask for sudo now, so we have it when we get to the image build +set -eu + +help() { + cat < result/iso/boot.iso.git_rev + +# build the anaconda rpms +make -f ./Makefile.am container-rpms-scratch + +# copy additional web UI packages +for i in $COPY_RPMS; do + cp "$i" "$PACKAGES_DIR" +done + +# build the ISO +if [ "$BUILD_TARGET" = "boot.iso" ]; then + make -f ./Makefile.am anaconda-iso-creator-build + make -f ./Makefile.am container-iso-build +elif [ "$BUILD_TARGET" = "live" ]; then + make -f ./Makefile.am anaconda-live-iso-creator-build + make -f ./Makefile.am container-live-iso-build +fi diff --git a/scripts/update_boot_iso b/scripts/testing/update_iso similarity index 98% rename from scripts/update_boot_iso rename to scripts/testing/update_iso index 41990b13aaa..0b4186d1a60 100755 --- a/scripts/update_boot_iso +++ b/scripts/testing/update_iso @@ -14,7 +14,11 @@ import sys import subprocess # Absolute path to the main project directory -PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +PROJECT_DIR = os.path.dirname( + os.path.dirname( + os.path.dirname(os.path.abspath(__file__)) + ) + ) # Relative path to the ISO folder within the project ISO_FOLDER = os.path.join(PROJECT_DIR, "result", "iso")