diff --git a/.gitignore b/.gitignore index f3333aa34ce..ddbac5b896a 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ ansible/*.txt test/variables.yaml test/scenario_settings.sh __pycache__ +test/dev_overrides.sh diff --git a/test/README.md b/test/README.md index 69113e7c265..c7d326635b5 100644 --- a/test/README.md +++ b/test/README.md @@ -698,3 +698,26 @@ The keys are then mounted for the job and copied to the `~/.aws/config` and > The procedure assumes that the `microshift-build-cache-` bucket exists > in the appropriate region. + +### Local Developer Overrides + +In some cases, it is necessary to override default values used by the +CI scripts to make them work in the local environment. If the file +`./test/dev_overrides.sh` exists, it is sourced by the test framework +scripts after initializing the common defaults and before computing +any per-script defaults. + +For example, creating the file with this content + +``` +#!/bin/bash +export AWS_BUCKET_NAME=microshift-build-cache-us-west-2 +export CI_JOB_NAME=local-dev +``` + +will ensure that a valid AWS bucket is used as the source of image +cache data and that scripts that check for the CI job name will have a +name pattern set to compare. + +NOTE: Include the shebang line with the shell set and export variables +to avoid issues with the shellcheck linter. diff --git a/test/bin/common.sh b/test/bin/common.sh index 67e1633c021..5ea6f51c602 100644 --- a/test/bin/common.sh +++ b/test/bin/common.sh @@ -207,3 +207,11 @@ SCENARIO_BUILD_TAG_PREV="$(date -d "yesterday" '+%y%m%d')" # The location of the awscli binary. # shellcheck disable=SC2034 # used elsewhere AWSCLI="${OUTPUTDIR}/bin/aws" + +# The location of developer overrides files. +DEV_OVERRIDES="${TESTDIR}/dev_overrides.sh" +if [ -f "${DEV_OVERRIDES}" ]; then + # The file will not exist, so we should not ask shellcheck to look for it. + # shellcheck disable=SC1090 + source "${DEV_OVERRIDES}" +fi diff --git a/test/dev_overrides.sh.example b/test/dev_overrides.sh.example new file mode 100644 index 00000000000..5d0708241cb --- /dev/null +++ b/test/dev_overrides.sh.example @@ -0,0 +1,8 @@ +#!/bin/bash + +# Variables used by ci_phase_iso_build.sh +export AWS_BUCKET_NAME=microshift-build-cache-us-west-2 +export CI_JOB_NAME=local-dev + +# Variables used by build_images.sh +export SKIP_LOG_COLLECTION=true