From 5b6d543ae580d61db49dca6eb8a23776a11fa41d Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Thu, 16 May 2024 15:22:03 +0200 Subject: [PATCH] only add grafana bearer token if it's not empty --- .../setup-create-base64-config-live-testnets/action.yml | 7 ++++++- .github/actions/setup-create-base64-config/action.yml | 7 ++++++- .../actions/setup-create-base64-upgrade-config/action.yml | 7 ++++++- .github/actions/setup-merge-base64-config/action.yml | 7 ++++++- .github/workflows/automation-ondemand-tests.yml | 7 ++++++- .github/workflows/client-compatibility-tests.yml | 7 ++++++- 6 files changed, 36 insertions(+), 6 deletions(-) diff --git a/.github/actions/setup-create-base64-config-live-testnets/action.yml b/.github/actions/setup-create-base64-config-live-testnets/action.yml index 0dac6e9d55b..64fc134b46e 100644 --- a/.github/actions/setup-create-base64-config-live-testnets/action.yml +++ b/.github/actions/setup-create-base64-config-live-testnets/action.yml @@ -89,6 +89,11 @@ runs: pyroscope_enabled=false fi + grafana_bearer_token="" + if [ -n "$GRAFANA_BEARER_TOKEN" ]; then + grafana_bearer_token="bearer_token_secret=\"$GRAFANA_BEARER_TOKEN\"" + fi + cat << EOF > config.toml [Common] chainlink_node_funding=0.5 @@ -118,7 +123,7 @@ runs: [Logging.Grafana] base_url="$GRAFANA_URL" dashboard_url="$GRAFANA_DASHBOARD_URL" - bearer_token_secret="$GRAFANA_BEARER_TOKEN" + $grafana_bearer_token [Network] selected_networks=["$NETWORK"] diff --git a/.github/actions/setup-create-base64-config/action.yml b/.github/actions/setup-create-base64-config/action.yml index 46de20b6cd6..d54554278d1 100644 --- a/.github/actions/setup-create-base64-config/action.yml +++ b/.github/actions/setup-create-base64-config/action.yml @@ -111,6 +111,11 @@ runs: else execution_layer="geth" fi + + grafana_bearer_token="" + if [ -n "$GRAFANA_BEARER_TOKEN" ]; then + grafana_bearer_token="bearer_token_secret=\"$GRAFANA_BEARER_TOKEN\"" + fi cat << EOF > config.toml [Network] @@ -142,7 +147,7 @@ runs: [Logging.Grafana] base_url="$GRAFANA_URL" dashboard_url="$GRAFANA_DASHBOARD_URL" - bearer_token_secret="$GRAFANA_BEARER_TOKEN" + $grafana_bearer_token [PrivateEthereumNetwork] execution_layer="$execution_layer" diff --git a/.github/actions/setup-create-base64-upgrade-config/action.yml b/.github/actions/setup-create-base64-upgrade-config/action.yml index a7cfcafde4c..c2d0bc19f35 100644 --- a/.github/actions/setup-create-base64-upgrade-config/action.yml +++ b/.github/actions/setup-create-base64-upgrade-config/action.yml @@ -83,6 +83,11 @@ runs: log_targets=$(convert_to_toml_array "$LOGSTREAM_LOG_TARGETS") + grafana_bearer_token="" + if [ -n "$GRAFANA_BEARER_TOKEN" ]; then + grafana_bearer_token="bearer_token_secret=\"$GRAFANA_BEARER_TOKEN\"" + fi + cat << EOF > config.toml [Network] selected_networks=$selected_networks @@ -112,7 +117,7 @@ runs: [Logging.Grafana] base_url="$GRAFANA_URL" dashboard_url="$GRAFANA_DASHBOARD_URL" - bearer_token_secret="$GRAFANA_BEARER_TOKEN" + $grafana_bearer_token EOF BASE64_CONFIG_OVERRIDE=$(cat config.toml | base64 -w 0) diff --git a/.github/actions/setup-merge-base64-config/action.yml b/.github/actions/setup-merge-base64-config/action.yml index 48ca96bf948..b734873c1f6 100644 --- a/.github/actions/setup-merge-base64-config/action.yml +++ b/.github/actions/setup-merge-base64-config/action.yml @@ -45,6 +45,11 @@ runs: echo "NETWORKS=$NETWORKS" >> $GITHUB_ENV fi + grafana_bearer_token="" + if [ -n "$GRAFANA_BEARER_TOKEN" ]; then + grafana_bearer_token="bearer_token_secret=\"$GRAFANA_BEARER_TOKEN\"" + fi + # use Loki config from GH secrets and merge it with base64 input cat << EOF > config.toml [Logging.Loki] @@ -57,7 +62,7 @@ runs: [Logging.Grafana] base_url="$GRAFANA_URL" dashboard_url="$GRAFANA_DASHBOARD_URL" - bearer_token_secret="$GRAFANA_BEARER_TOKEN" + $grafana_bearer_token EOF echo "$decoded_toml" >> final_config.toml diff --git a/.github/workflows/automation-ondemand-tests.yml b/.github/workflows/automation-ondemand-tests.yml index c232a6ba9e6..710cd72e1b4 100644 --- a/.github/workflows/automation-ondemand-tests.yml +++ b/.github/workflows/automation-ondemand-tests.yml @@ -273,6 +273,11 @@ jobs: log_targets=$(convert_to_toml_array "$LOGSTREAM_LOG_TARGETS") + grafana_bearer_token="" + if [ -n "$GRAFANA_BEARER_TOKEN" ]; then + grafana_bearer_token="bearer_token_secret=\"$GRAFANA_BEARER_TOKEN\"" + fi + cat << EOF > config.toml [Network] selected_networks=$selected_networks @@ -300,7 +305,7 @@ jobs: [Logging.Grafana] base_url="$GRAFANA_URL" dashboard_url="$GRAFANA_DASHBOARD_URL" - bearer_token_secret="$GRAFANA_BEARER_TOKEN" + $grafana_bearer_token [Pyroscope] enabled=$pyroscope_enabled diff --git a/.github/workflows/client-compatibility-tests.yml b/.github/workflows/client-compatibility-tests.yml index 6b327824fb6..43e366c478c 100644 --- a/.github/workflows/client-compatibility-tests.yml +++ b/.github/workflows/client-compatibility-tests.yml @@ -195,6 +195,11 @@ jobs: pyroscope_enabled=false fi + grafana_bearer_token="" + if [ -n "$GRAFANA_BEARER_TOKEN" ]; then + grafana_bearer_token="bearer_token_secret=\"$GRAFANA_BEARER_TOKEN\"" + fi + cat << EOF > config.toml [Network] selected_networks=$selected_networks @@ -212,7 +217,7 @@ jobs: [Logging.Grafana] base_url="$GRAFANA_URL" dashboard_url="$GRAFANA_DASHBOARD_URL" - bearer_token_secret="$GRAFANA_BEARER_TOKEN" + $grafana_bearer_token [PrivateEthereumNetwork] ethereum_version="eth2"