Skip to content

Commit

Permalink
only add grafana bearer token if it's not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofel committed May 16, 2024
1 parent 49f1bf3 commit 5b6d543
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"]
Expand Down
7 changes: 6 additions & 1 deletion .github/actions/setup-create-base64-config/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 6 additions & 1 deletion .github/actions/setup-merge-base64-config/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/automation-ondemand-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/client-compatibility-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down

0 comments on commit 5b6d543

Please sign in to comment.