From 95a43b48aec1860010cc887ca79c54cf264157b8 Mon Sep 17 00:00:00 2001 From: Ian Howell Date: Wed, 1 Sep 2021 16:15:57 -0500 Subject: [PATCH] Update 22_test_configs.sh to use new document pull This causes the 22_test_configs.sh to create an airship config file which supports the new document pull feature introduced in https://opendev.org/airship/airshipctl/commit/cb080a20664196e61b0586b7ef7ecdb3a1090c88 Change-Id: I057bd2420f488a9f91ed69d09f73b1336827e7a2 Relates-To: #623 Change-Id: I7bbf052877e4918e168fc4005ea899aa700bae41 --- tools/deployment/22_test_configs.sh | 9 ++++++++- tools/deployment/templates/airshipconfig_template | 6 ++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/tools/deployment/22_test_configs.sh b/tools/deployment/22_test_configs.sh index 1acfd2045..2400c75a6 100755 --- a/tools/deployment/22_test_configs.sh +++ b/tools/deployment/22_test_configs.sh @@ -34,7 +34,14 @@ export SITE=${SITE:-"test-site"} export AIRSHIP_CONFIG_METADATA_PATH=${AIRSHIP_CONFIG_METADATA_PATH:-"manifests/site/${SITE}/metadata.yaml"} export SYSTEM_ACTION_RETRIES=30 export SYSTEM_REBOOT_DELAY=30 -export AIRSHIP_CONFIG_PHASE_REPO_BRANCH=${BRANCH:-"master"} +# Branch and ref options are mutually exclusive. Ref gets preference since it's more specific +if [[ -z "$AIRSHIP_CONFIG_PHASE_REPO_REF" ]]; then + export AIRSHIP_CONFIG_PHASE_REPO_BRANCH=${BRANCH:-"master"} + export AIRSHIP_CONFIG_PHASE_REPO_REMOTE_REF="" +else + export AIRSHIP_CONFIG_PHASE_REPO_BRANCH="" + export AIRSHIP_CONFIG_PHASE_REPO_REMOTE_REF="$AIRSHIP_CONFIG_PHASE_REPO_REF:$AIRSHIP_CONFIG_PHASE_REPO_REF" +fi # the git repo url or local file system path to a cloned repo, e.g., /home/stack/airshipctl export AIRSHIP_CONFIG_PHASE_REPO_URL=${AIRSHIP_CONFIG_PHASE_REPO_URL:-"https://review.opendev.org/airship/airshipctl"} export AIRSHIP_CONFIG_PHASE_REPO_NAME=${AIRSHIP_CONFIG_PHASE_REPO_NAME:-"airshipctl"} diff --git a/tools/deployment/templates/airshipconfig_template b/tools/deployment/templates/airshipconfig_template index 0a5c4311b..b18a18c30 100644 --- a/tools/deployment/templates/airshipconfig_template +++ b/tools/deployment/templates/airshipconfig_template @@ -21,10 +21,12 @@ manifests: repositories: primary: checkout: - branch: ${AIRSHIP_CONFIG_PHASE_REPO_BRANCH} + branch: "${AIRSHIP_CONFIG_PHASE_REPO_BRANCH}" force: false - remoteRef: "" + ref: "${AIRSHIP_CONFIG_PHASE_REPO_REF}" tag: "" + fetch: + remoteRefSpec: "${AIRSHIP_CONFIG_PHASE_REPO_REMOTE_REF}" url: ${AIRSHIP_CONFIG_PHASE_REPO_URL} metadataPath: ${AIRSHIP_CONFIG_METADATA_PATH} targetPath: ${AIRSHIP_CONFIG_MANIFEST_DIRECTORY}