From 0706575ef4eb22c2e81ba572d8f258c8cae3aa63 Mon Sep 17 00:00:00 2001 From: Drew Walters Date: Mon, 17 Aug 2020 14:03:51 +0000 Subject: [PATCH] Add multi-site support to gate runner This change adds multi-site support to the gate runner by leveraging environment variables used by the deployment scripts. Zuul jobs can change the site by defining the site variable in the job definition. If no site name is specified, test-site is used as a default. Example: - job: name: gate-script-runner-site-b vars: site: site-b This change will allow the treasuremap repository to test multiple sites using the same job definitions. Change-Id: I5ed02d2563db2d2b3b1587fcac94ad2bce805ced Signed-off-by: Drew Walters --- roles/airshipctl-run-script/tasks/main.yaml | 2 ++ tools/deployment/22_test_configs.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/roles/airshipctl-run-script/tasks/main.yaml b/roles/airshipctl-run-script/tasks/main.yaml index 24166b6c8..70fe843da 100644 --- a/roles/airshipctl-run-script/tasks/main.yaml +++ b/roles/airshipctl-run-script/tasks/main.yaml @@ -20,3 +20,5 @@ default_zuul_dir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}" environment: AIRSHIP_CONFIG_MANIFEST_DIRECTORY: "{{ remote_work_dir | default(local_src_dir) | default(default_zuul_dir) }}" + AIRSHIP_SITE_NAME: "manifests/site/{{ site | default('test-site') }}" + SITE_NAME: "{{ site | default('test-site') }}" diff --git a/tools/deployment/22_test_configs.sh b/tools/deployment/22_test_configs.sh index 73eaf260d..33bddd494 100755 --- a/tools/deployment/22_test_configs.sh +++ b/tools/deployment/22_test_configs.sh @@ -35,7 +35,7 @@ export SYSTEM_REBOOT_DELAY=30 export AIRSHIP_CONFIG_PRIMARY_REPO_BRANCH=${BRANCH:-"master"} # the git repo url or local file system path to a cloned repo, e.g., /home/stack/airshipctl export AIRSHIP_CONFIG_PRIMARY_REPO_URL=${REPO:-"https://review.opendev.org/airship/airshipctl"} -export AIRSHIP_SITE_NAME="manifests/site/test-site" +export AIRSHIP_SITE_NAME=${AIRSHIP_SITE_NAME:-"manifests/site/test-site"} export AIRSHIP_CONFIG_MANIFEST_DIRECTORY=${AIRSHIP_CONFIG_MANIFEST_DIRECTORY:-"/tmp/airship"} export AIRSHIP_CONFIG_CA_DATA=$(cat tools/deployment/certificates/airship_config_ca_data| base64 -w0) export AIRSHIP_CONFIG_EPHEMERAL_IP=${IP_Ephemeral:-"10.23.25.101"}