Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions .evergreen-functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/dev/contexts/e2e_mdb_kind_ubi_cloudqa
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/dev/contexts/e2e_smoke_ibm_power
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion scripts/dev/contexts/e2e_smoke_ibm_z
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion scripts/dev/contexts/e2e_static_mdb_kind_ubi_cloudqa
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/dev/contexts/e2e_static_smoke_arm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/dev/contexts/e2e_static_smoke_ibm_power
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/dev/contexts/e2e_static_smoke_ibm_z
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions scripts/dev/contexts/funcs/gke
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/usr/bin/env bash

set -Eeou pipefail
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not necessary as the file is only sourced, not executed directly

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True! At the same time it helps mark the file in IDE as bash script ;)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True! At the same time it helps mark the file in IDE as bash script ;)

Not requesting to change this. Just joining the chat :)

From my experience adding a shebang is usually enough for IDEs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I thought that Łukasz commented all added lines. But I agree pipefail is not needed, but also harmless ;)


# Function to normalize identifier to contain only alphanumeric characters.
# It's also cutting the string in the middle if exceeds max_len.
# Example:
Expand Down
5 changes: 1 addition & 4 deletions scripts/dev/contexts/variables/om60
Original file line number Diff line number Diff line change
Expand Up @@ -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}')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not something for this PR, but I think we should switch for yq/jq for reading yaml/json instead of awk.

export CUSTOM_OM_VERSION

export CUSTOM_MDB_VERSION=6.0.21
Expand Down
5 changes: 1 addition & 4 deletions scripts/dev/contexts/variables/om60_image
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 2 additions & 5 deletions scripts/dev/contexts/variables/om70
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions scripts/dev/contexts/variables/om70_image
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 2 additions & 5 deletions scripts/dev/contexts/variables/om80
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions scripts/dev/contexts/variables/om80_image
Original file line number Diff line number Diff line change
Expand Up @@ -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