Skip to content

Commit

Permalink
Docker: set/unset stereotype via env var SE_NODE_PLATFORM_NAME (#2525)
Browse files Browse the repository at this point in the history
Signed-off-by: Viet Nguyen Duc <[email protected]>
  • Loading branch information
VietND96 authored Dec 23, 2024
1 parent 8e8f074 commit b75e36c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions NodeBase/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ ENV LANG_WHICH=${LANG_WHICH} \
# Setting Selenium Manager to work offline
SE_OFFLINE=true \
SE_NODE_BROWSER_VERSION="stable" \
SE_NODE_PLATFORM_NAME="Linux" \
#============================
# Some configuration options
#============================
Expand Down
4 changes: 2 additions & 2 deletions NodeBase/generate_config
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ echo "max-sessions = ${SE_NODE_MAX_CONCURRENCY:-${SE_NODE_MAX_SESSIONS}}
if [ -f /opt/selenium/browser_name ]; then
SE_NODE_BROWSER_NAME=$(cat /opt/selenium/browser_name)
fi
if [ -f /opt/selenium/browser_version ] && [ "${SE_NODE_BROWSER_VERSION}" = "stable" ]; then
if [ -f /opt/selenium/browser_version ] && [ "${SE_NODE_BROWSER_VERSION,,}" = "stable" ]; then
SE_NODE_BROWSER_VERSION=$(short_version $(cat /opt/selenium/browser_version))
fi
if [ -f /opt/selenium/browser_binary_location ] && [ -z "${SE_BROWSER_BINARY_LOCATION}" ]; then
Expand All @@ -64,7 +64,7 @@ fi

# 'browserName' is mandatory for default stereotype
if [[ -z "${SE_NODE_STEREOTYPE}" ]] && [[ -n "${SE_NODE_BROWSER_NAME}" ]]; then
SE_NODE_STEREOTYPE="{\"browserName\": \"${SE_NODE_BROWSER_NAME}\", \"browserVersion\": \"${SE_NODE_BROWSER_VERSION}\", \"platformName\": \"Linux\", ${SE_BROWSER_BINARY_LOCATION}, \"se:containerName\": \"${SE_NODE_CONTAINER_NAME}\"}"
SE_NODE_STEREOTYPE="{\"browserName\": \"${SE_NODE_BROWSER_NAME}\", \"browserVersion\": \"${SE_NODE_BROWSER_VERSION}\", \"platformName\": \"${SE_NODE_PLATFORM_NAME}\", ${SE_BROWSER_BINARY_LOCATION}, \"se:containerName\": \"${SE_NODE_CONTAINER_NAME}\"}"
else
SE_NODE_STEREOTYPE="${SE_NODE_STEREOTYPE}"
fi
Expand Down

0 comments on commit b75e36c

Please sign in to comment.