-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to use KUBECONFIG when calling ods_ci/build/run.sh
Signed-off-by: manosnoam <[email protected]>
- Loading branch information
Showing
1 changed file
with
20 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,32 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
echo RUN SCRIPT ARGS: "${RUN_SCRIPT_ARGS}" | ||
echo ROBOT EXTRA ARGS: "${ROBOT_EXTRA_ARGS}" | ||
echo SET TEST ENVIRONMENT: "${SET_ENVIRONMENT}" | ||
echo -- USE OCM to install IDPs: "${USE_OCM_IDP}" | ||
|
||
echo "Set Kubeconfig file path to: ${KUBECONFIG}" | ||
export "KUBECONFIG=${KUBECONFIG}" | ||
|
||
# feature requested for MPS pipeline onboarding | ||
if [ "${SET_ENVIRONMENT}" -eq 1 ]; then \ | ||
if [ -z "${OC_HOST}" ] | ||
then | ||
echo -e "\033[0;33m You must set the OC_HOST env variable to automatically set the Test Environment for ODS-CI \033[0m" | ||
if [ "${SET_ENVIRONMENT}" -eq 1 ]; then | ||
if [ -z "${OC_HOST}" ]; then | ||
echo -e "\033[0;33m You must set the OC_HOST env variable to automatically set the Test Environment for ODS-CI \033[0m" | ||
exit 0 | ||
else | ||
if [ "${USE_OCM_IDP}" -eq 0 ]; then | ||
actual_host="$(oc whoami --show-server)" | ||
if [ -z "${RUN_FROM_CONTAINER}" ] && [ "${actual_host}" != "${OC_HOST}" ]; then | ||
echo "-----| USE_OCM_IDP option is disabled, but you are connected to a different cluster than ${OC_HOST}. To prevent you to change IDPs of the wrong cluster, ODS-CI stops here... |-----" | ||
exit 0 | ||
else | ||
if [ "${USE_OCM_IDP}" -eq 0 ] | ||
then | ||
actual_host="$(oc whoami --show-server)" | ||
if [ -z "${RUN_FROM_CONTAINER}" ] && [ "${actual_host}" != "${OC_HOST}" ] | ||
then | ||
echo "-----| USE_OCM_IDP option is disabled, but you are connected to a different cluster than ${OC_HOST}. To prevent you to change IDPs of the wrong cluster, ODS-CI stops here...|-----" | ||
exit 0 | ||
fi | ||
fi | ||
echo "-----| SET_ENVIRONMENT option is enabled. ODS-CI is going to configure the test environment for you..|-----" | ||
./ods_ci/build/install_idp.sh | ||
fi | ||
fi | ||
echo "-----| SET_ENVIRONMENT option is enabled. ODS-CI is going to create IDP users |-----" | ||
./ods_ci/build/install_idp.sh | ||
fi | ||
else | ||
echo "-----| SET_ENVIRONMENT option is disabled. Skipping test environment setup |-----" | ||
fi | ||
echo "-----| ODS-CI is starting the tests run...|-----" | ||
./ods_ci/run_robot_test.sh --skip-install ${RUN_SCRIPT_ARGS} --extra-robot-args "${ROBOT_EXTRA_ARGS}" | ||
Check warning on line 32 in ods_ci/build/run.sh GitHub Actions / shellcheck linter
|
||
|