diff --git a/.evergreen-functions.yml b/.evergreen-functions.yml index 3a7ee39b8..760131617 100644 --- a/.evergreen-functions.yml +++ b/.evergreen-functions.yml @@ -77,19 +77,15 @@ functions: echo "Finished initializing to the root context" switch_context: &switch_context - command: shell.exec + command: subprocess.exec type: setup params: - shell: bash working_dir: src/github.com/mongodb/mongodb-kubernetes <<: *e2e_include_expansions_in_env add_to_path: - ${workdir}/bin - ${workdir}/google-cloud-sdk/bin - script: | - echo "Switching context" - scripts/dev/switch_context.sh "${build_variant}" - echo "Finished switching context" + command: scripts/dev/switch_context.sh "${build_variant}" python_venv: &python_venv command: subprocess.exec @@ -249,7 +245,7 @@ functions: working_dir: src/github.com/mongodb/mongodb-kubernetes add_to_path: - ${workdir}/bin - command: scripts/dev/setup_chart_testing_cli.sh + command: scripts/dev/setup_chart_testing_cli.sh lint_repo: - command: subprocess.exec @@ -305,7 +301,6 @@ functions: # the task configures the set of tools necessary for any task working with K8 cluster: # installs kubectl, jq, kind (if necessary), configures docker authentication download_kube_tools: - - *switch_context - *setup_kubectl - *setup_jq # we need aws to configure docker authentication diff --git a/scripts/dev/contexts/e2e_mdb_kind_ubi_cloudqa b/scripts/dev/contexts/e2e_mdb_kind_ubi_cloudqa index 886ecb8be..f230f6d2a 100644 --- a/scripts/dev/contexts/e2e_mdb_kind_ubi_cloudqa +++ b/scripts/dev/contexts/e2e_mdb_kind_ubi_cloudqa @@ -11,7 +11,7 @@ export ops_manager_version="cloud_qa" # This is required to be able to rebuild the om image and use that image which has been rebuilt export OPS_MANAGER_REGISTRY="${BASE_REPO_URL}" -CUSTOM_OM_VERSION=$(grep -E "^\s*-\s*&ops_manager_70_latest\s+(\S+)\s+#" <"${script_dir}"/../../../.evergreen.yml | awk '{print $3}') +CUSTOM_OM_VERSION=$(grep -E "^\s*-\s*&ops_manager_70_latest\s+(\S+)\s+#" <"${PROJECT_DIR}"/.evergreen.yml | awk '{print $3}') export CUSTOM_OM_VERSION export CUSTOM_MDB_VERSION=6.0.5 diff --git a/scripts/dev/contexts/e2e_smoke_ibm_power b/scripts/dev/contexts/e2e_smoke_ibm_power index 77c1cf549..50047fbdc 100644 --- a/scripts/dev/contexts/e2e_smoke_ibm_power +++ b/scripts/dev/contexts/e2e_smoke_ibm_power @@ -10,5 +10,5 @@ source "${script_dir}/variables/e2e_ibm_smoke_base" # This is required to be able to rebuild the om image and use that image which has been rebuilt export OPS_MANAGER_REGISTRY=268558157000.dkr.ecr.us-east-1.amazonaws.com/dev -CUSTOM_OM_VERSION=$(grep -E "^\s*-\s*&ops_manager_70_latest\s+(\S+)\s+#" <"${script_dir}"/../../../.evergreen.yml | awk '{print $3}') +CUSTOM_OM_VERSION=$(grep -E "^\s*-\s*&ops_manager_70_latest\s+(\S+)\s+#" <"${PROJECT_DIR}"/.evergreen.yml | awk '{print $3}') export CUSTOM_OM_VERSION diff --git a/scripts/dev/contexts/e2e_smoke_ibm_z b/scripts/dev/contexts/e2e_smoke_ibm_z index 77c1cf549..50047fbdc 100644 --- a/scripts/dev/contexts/e2e_smoke_ibm_z +++ b/scripts/dev/contexts/e2e_smoke_ibm_z @@ -10,5 +10,5 @@ source "${script_dir}/variables/e2e_ibm_smoke_base" # This is required to be able to rebuild the om image and use that image which has been rebuilt export OPS_MANAGER_REGISTRY=268558157000.dkr.ecr.us-east-1.amazonaws.com/dev -CUSTOM_OM_VERSION=$(grep -E "^\s*-\s*&ops_manager_70_latest\s+(\S+)\s+#" <"${script_dir}"/../../../.evergreen.yml | awk '{print $3}') +CUSTOM_OM_VERSION=$(grep -E "^\s*-\s*&ops_manager_70_latest\s+(\S+)\s+#" <"${PROJECT_DIR}"/.evergreen.yml | awk '{print $3}') export CUSTOM_OM_VERSION diff --git a/scripts/dev/contexts/e2e_static_mdb_kind_ubi_cloudqa b/scripts/dev/contexts/e2e_static_mdb_kind_ubi_cloudqa index f4fe1ebdb..9188ba8af 100644 --- a/scripts/dev/contexts/e2e_static_mdb_kind_ubi_cloudqa +++ b/scripts/dev/contexts/e2e_static_mdb_kind_ubi_cloudqa @@ -12,7 +12,7 @@ export MDB_DEFAULT_ARCHITECTURE=static # This is required to be able to rebuild the om image and use that image which has been rebuilt export OPS_MANAGER_REGISTRY="${BASE_REPO_URL}" -CUSTOM_OM_VERSION=$(grep -E "^\s*-\s*&ops_manager_70_latest\s+(\S+)\s+#" <"${script_dir}"/../../../.evergreen.yml | awk '{print $3}') +CUSTOM_OM_VERSION=$(grep -E "^\s*-\s*&ops_manager_70_latest\s+(\S+)\s+#" <"${PROJECT_DIR}"/.evergreen.yml | awk '{print $3}') export CUSTOM_OM_VERSION export CUSTOM_MDB_PREV_VERSION=6.0.16 diff --git a/scripts/dev/contexts/e2e_static_smoke_arm b/scripts/dev/contexts/e2e_static_smoke_arm index 65f0c3dfe..00976ea0d 100644 --- a/scripts/dev/contexts/e2e_static_smoke_arm +++ b/scripts/dev/contexts/e2e_static_smoke_arm @@ -11,7 +11,7 @@ export ops_manager_version="cloud_qa" # This is required to be able to rebuild the om image and use that image which has been rebuilt export OPS_MANAGER_REGISTRY=268558157000.dkr.ecr.us-east-1.amazonaws.com/dev -CUSTOM_OM_VERSION=$(grep -E "^\s*-\s*&ops_manager_70_latest\s+(\S+)\s+#" <"${script_dir}"/../../../.evergreen.yml | awk '{print $3}') +CUSTOM_OM_VERSION=$(grep -E "^\s*-\s*&ops_manager_70_latest\s+(\S+)\s+#" <"${PROJECT_DIR}"/.evergreen.yml | awk '{print $3}') export CUSTOM_OM_VERSION export CUSTOM_MDB_VERSION=7.0.22 # we only have ibm static images starting with 7.0.22 diff --git a/scripts/dev/contexts/e2e_static_smoke_ibm_power b/scripts/dev/contexts/e2e_static_smoke_ibm_power index d31b03fd0..bb4d2a8ca 100644 --- a/scripts/dev/contexts/e2e_static_smoke_ibm_power +++ b/scripts/dev/contexts/e2e_static_smoke_ibm_power @@ -10,7 +10,7 @@ source "${script_dir}/variables/e2e_ibm_smoke_base" # This is required to be able to rebuild the om image and use that image which has been rebuilt export OPS_MANAGER_REGISTRY=268558157000.dkr.ecr.us-east-1.amazonaws.com/dev -CUSTOM_OM_VERSION=$(grep -E "^\s*-\s*&ops_manager_70_latest\s+(\S+)\s+#" <"${script_dir}"/../../../.evergreen.yml | awk '{print $3}') +CUSTOM_OM_VERSION=$(grep -E "^\s*-\s*&ops_manager_70_latest\s+(\S+)\s+#" <"${PROJECT_DIR}"/.evergreen.yml | awk '{print $3}') export CUSTOM_OM_VERSION export MDB_DEFAULT_ARCHITECTURE=static # MDB supports ppc64le on RHEL9 only from 8.0.12 onwards diff --git a/scripts/dev/contexts/e2e_static_smoke_ibm_z b/scripts/dev/contexts/e2e_static_smoke_ibm_z index aeaa8423d..9acff493a 100644 --- a/scripts/dev/contexts/e2e_static_smoke_ibm_z +++ b/scripts/dev/contexts/e2e_static_smoke_ibm_z @@ -10,7 +10,7 @@ source "${script_dir}/variables/e2e_ibm_smoke_base" # This is required to be able to rebuild the om image and use that image which has been rebuilt export OPS_MANAGER_REGISTRY=268558157000.dkr.ecr.us-east-1.amazonaws.com/dev -CUSTOM_OM_VERSION=$(grep -E "^\s*-\s*&ops_manager_70_latest\s+(\S+)\s+#" <"${script_dir}"/../../../.evergreen.yml | awk '{print $3}') +CUSTOM_OM_VERSION=$(grep -E "^\s*-\s*&ops_manager_70_latest\s+(\S+)\s+#" <"${PROJECT_DIR}"/.evergreen.yml | awk '{print $3}') export CUSTOM_OM_VERSION export MDB_DEFAULT_ARCHITECTURE=static # MDB supports s390x on RHEL9 only from 8.0.12 onwards diff --git a/scripts/dev/contexts/funcs/gke b/scripts/dev/contexts/funcs/gke index 11df26f85..658349337 100644 --- a/scripts/dev/contexts/funcs/gke +++ b/scripts/dev/contexts/funcs/gke @@ -1,3 +1,7 @@ +#!/usr/bin/env bash + +set -Eeou pipefail + # Function to normalize identifier to contain only alphanumeric characters. # It's also cutting the string in the middle if exceeds max_len. # Example: diff --git a/scripts/dev/contexts/variables/om60 b/scripts/dev/contexts/variables/om60 index e2e77e3ab..82927dd87 100644 --- a/scripts/dev/contexts/variables/om60 +++ b/scripts/dev/contexts/variables/om60 @@ -2,12 +2,9 @@ set -Eeou pipefail -script_name=$(readlink -f "${BASH_SOURCE[0]}") -script_dir=$(dirname "${script_name}") - CUSTOM_OM_PREV_VERSION=6.0.0 export CUSTOM_OM_PREV_VERSION -CUSTOM_OM_VERSION=$(grep -E "^\s*-\s*&ops_manager_60_latest\s+(\S+)\s+#" <"${script_dir}"/../../../../.evergreen.yml | awk '{print $3}') +CUSTOM_OM_VERSION=$(grep -E "^\s*-\s*&ops_manager_60_latest\s+(\S+)\s+#" <"${PROJECT_DIR}"/.evergreen.yml | awk '{print $3}') export CUSTOM_OM_VERSION export CUSTOM_MDB_VERSION=6.0.21 diff --git a/scripts/dev/contexts/variables/om60_image b/scripts/dev/contexts/variables/om60_image index 1c4ee1ae6..6a2488d51 100644 --- a/scripts/dev/contexts/variables/om60_image +++ b/scripts/dev/contexts/variables/om60_image @@ -2,8 +2,5 @@ set -Eeou pipefail -script_name=$(readlink -f "${BASH_SOURCE[0]}") -script_dir=$(dirname "${script_name}") - -om_version=$(grep -E "^\s*-\s*&ops_manager_60_latest\s+(\S+)\s+#" < "${script_dir}"/../../../../.evergreen.yml | awk '{print $3}') +om_version=$(grep -E "^\s*-\s*&ops_manager_60_latest\s+(\S+)\s+#" < "${PROJECT_DIR}"/.evergreen.yml | awk '{print $3}') export om_version diff --git a/scripts/dev/contexts/variables/om70 b/scripts/dev/contexts/variables/om70 index c0c8b0eb7..114fbe533 100644 --- a/scripts/dev/contexts/variables/om70 +++ b/scripts/dev/contexts/variables/om70 @@ -2,12 +2,9 @@ set -Eeou pipefail -script_name=$(readlink -f "${BASH_SOURCE[0]}") -script_dir=$(dirname "${script_name}") - -CUSTOM_OM_PREV_VERSION=$(grep -E "^\s*-\s*&ops_manager_60_latest\s+(\S+)\s+#" <"${script_dir}"/../../../../.evergreen.yml | awk '{print $3}') +CUSTOM_OM_PREV_VERSION=$(grep -E "^\s*-\s*&ops_manager_60_latest\s+(\S+)\s+#" <"${PROJECT_DIR}"/.evergreen.yml | awk '{print $3}') export CUSTOM_OM_PREV_VERSION -CUSTOM_OM_VERSION=$(grep -E "^\s*-\s*&ops_manager_70_latest\s+(\S+)\s+#" <"${script_dir}"/../../../../.evergreen.yml | awk '{print $3}') +CUSTOM_OM_VERSION=$(grep -E "^\s*-\s*&ops_manager_70_latest\s+(\S+)\s+#" <"${PROJECT_DIR}"/.evergreen.yml | awk '{print $3}') export CUSTOM_OM_VERSION export CUSTOM_MDB_VERSION=7.0.18 diff --git a/scripts/dev/contexts/variables/om70_image b/scripts/dev/contexts/variables/om70_image index 108fe158e..aec42bb8a 100644 --- a/scripts/dev/contexts/variables/om70_image +++ b/scripts/dev/contexts/variables/om70_image @@ -2,8 +2,5 @@ set -Eeou pipefail -script_name=$(readlink -f "${BASH_SOURCE[0]}") -script_dir=$(dirname "${script_name}") - -om_version=$(grep -E "^\s*-\s*&ops_manager_70_latest\s+(\S+)\s+#" < "${script_dir}"/../../../../.evergreen.yml | awk '{print $3}') +om_version=$(grep -E "^\s*-\s*&ops_manager_70_latest\s+(\S+)\s+#" < "${PROJECT_DIR}"/.evergreen.yml | awk '{print $3}') export om_version diff --git a/scripts/dev/contexts/variables/om80 b/scripts/dev/contexts/variables/om80 index f0b677d90..3b4a2db54 100644 --- a/scripts/dev/contexts/variables/om80 +++ b/scripts/dev/contexts/variables/om80 @@ -2,12 +2,9 @@ set -Eeou pipefail -script_name=$(readlink -f "${BASH_SOURCE[0]}") -script_dir=$(dirname "${script_name}") - -CUSTOM_OM_PREV_VERSION=$(grep -E "^\s*-\s*&ops_manager_70_latest\s+(\S+)\s+#" < "${script_dir}"/../../../../.evergreen.yml | awk '{print $3}') +CUSTOM_OM_PREV_VERSION=$(grep -E "^\s*-\s*&ops_manager_70_latest\s+(\S+)\s+#" < "${PROJECT_DIR}"/.evergreen.yml | awk '{print $3}') export CUSTOM_OM_PREV_VERSION -CUSTOM_OM_VERSION=$(grep -E "^\s*-\s*&ops_manager_80_latest\s+(\S+)\s+#" < "${script_dir}"/../../../../.evergreen.yml | awk '{print $3}') +CUSTOM_OM_VERSION=$(grep -E "^\s*-\s*&ops_manager_80_latest\s+(\S+)\s+#" < "${PROJECT_DIR}"/.evergreen.yml | awk '{print $3}') export CUSTOM_OM_VERSION export CUSTOM_MDB_VERSION=8.0.6 diff --git a/scripts/dev/contexts/variables/om80_image b/scripts/dev/contexts/variables/om80_image index 7821d0b01..2931aa8f6 100644 --- a/scripts/dev/contexts/variables/om80_image +++ b/scripts/dev/contexts/variables/om80_image @@ -2,10 +2,7 @@ set -Eeou pipefail -script_name=$(readlink -f "${BASH_SOURCE[0]}") -script_dir=$(dirname "${script_name}") - -om_version=$(grep -E "^\s*-\s*&ops_manager_80_latest\s+(\S+)\s+#" < "${script_dir}"/../../../../.evergreen.yml | awk '{print $3}') +om_version=$(grep -E "^\s*-\s*&ops_manager_80_latest\s+(\S+)\s+#" < "${PROJECT_DIR}"/.evergreen.yml | awk '{print $3}') export om_version export om_download_url