diff --git a/04_setup_ironic.sh b/04_setup_ironic.sh index 5e56dad87..123ee95f7 100755 --- a/04_setup_ironic.sh +++ b/04_setup_ironic.sh @@ -62,6 +62,15 @@ for IMAGE_VAR in $(env | grep "_LOCAL_IMAGE=" | grep -o "^[^=]*") ; do fi done fi + + # If we set a specific PR number for the image, we can test it locally + IMAGE_PR_VAR=${IMAGE_VAR/_LOCAL_IMAGE}_PR + IMAGE_PR=${!IMAGE_PR_VAR:-} + if [[ -n ${IMAGE_PR:-} ]]; then + git fetch origin pull/${IMAGE_PR}/head:pr${IMAGE_PR} + git checkout pr${IMAGE_PR} + fi + # If we built a custom base image, we should use it as a new base in # the Dockerfile to prevent discrepancies between locally built images. # Replace all FROM entries with the base-image. diff --git a/config_example.sh b/config_example.sh index a792dc4f4..0882201b6 100755 --- a/config_example.sh +++ b/config_example.sh @@ -33,6 +33,12 @@ set -x # .repo file, e.g. if the filename is ocp46.repo # export CUSTOM_REPO_FILE=ocp46.repo +# If needed, we can fetch the change associated to a Pull Request for the images +# we're building locally. Specifying the PR number will fetch the PR, switch the +# local image repo to it, and build the image locally with that specific change. +# For example, for the PR #34 for the ironic-image: +# export IRONIC_PR=34 + # IP stack version. The default is "v6". You may also set "v4". # For dual stack (IPv4 + IPv6), use "v4v6". #export IP_STACK=v4