Commit f8fd897f authored by Wyatt Barnes's avatar Wyatt Barnes

ufm-metamask correct envs

parent 9ee5ac1f
...@@ -15,7 +15,7 @@ METRICS_WRITE_URL="http://pushgateway:9091" ...@@ -15,7 +15,7 @@ METRICS_WRITE_URL="http://pushgateway:9091"
# Dictates how the request body is structured when pushing metrics. Should be either "grafana" or "prometheus-pushgateway" # Dictates how the request body is structured when pushing metrics. Should be either "grafana" or "prometheus-pushgateway"
METRICS_WRITE_TOOL="prometheus-pushgateway" METRICS_WRITE_TOOL="prometheus-pushgateway"
# This is the source the pushed metric will be labeled as originting from. May not need this value # This is the source the pushed metric will be labeled as originting from. May not need this value
METRIC_WRITE_SOURCE="" METRICS_WRITE_SOURCE=""
# The needed credentials to access METRICS_READ_URL. Will be sent as: Authorization: Bearer username:password # The needed credentials to access METRICS_READ_URL. Will be sent as: Authorization: Bearer username:password
METRICS_WRITE_USERNAME="" METRICS_WRITE_USERNAME=""
METRICS_WRITE_PASSWORD="" METRICS_WRITE_PASSWORD=""
......
...@@ -15,7 +15,7 @@ METRICS_WRITE_URL="http://pushgateway:9091" ...@@ -15,7 +15,7 @@ METRICS_WRITE_URL="http://pushgateway:9091"
# Dictates how the request body is structured when pushing metrics. Should be either "grafana" or "prometheus-pushgateway" # Dictates how the request body is structured when pushing metrics. Should be either "grafana" or "prometheus-pushgateway"
METRICS_WRITE_TOOL="prometheus-pushgateway" METRICS_WRITE_TOOL="prometheus-pushgateway"
# This is the source the pushed metric will be labeled as originting from. May not need this value # This is the source the pushed metric will be labeled as originting from. May not need this value
METRIC_WRITE_SOURCE="" METRICS_WRITE_SOURCE=""
# The needed credentials to access METRICS_READ_URL. Will be sent as: Authorization: Bearer username:password # The needed credentials to access METRICS_READ_URL. Will be sent as: Authorization: Bearer username:password
METRICS_WRITE_USERNAME="" METRICS_WRITE_USERNAME=""
METRICS_WRITE_PASSWORD="" METRICS_WRITE_PASSWORD=""
......
...@@ -42,7 +42,7 @@ services: ...@@ -42,7 +42,7 @@ services:
context: ./metamask context: ./metamask
dockerfile: Dockerfile dockerfile: Dockerfile
args: args:
- METAMASK_RUN_HEADLESS=${METAMASK_RUN_HEADLESS} - METAMASK_PLAYWRIGHT_RUN_HEADLESS=${METAMASK_PLAYWRIGHT_RUN_HEADLESS}
container_name: test-service-metamask container_name: test-service-metamask
profiles: ["5minute"] profiles: ["5minute"]
environment: environment:
...@@ -54,7 +54,7 @@ services: ...@@ -54,7 +54,7 @@ services:
METRICS_READ_PASSWORD: ${METRICS_READ_PASSWORD} METRICS_READ_PASSWORD: ${METRICS_READ_PASSWORD}
METRICS_WRITE_URL: ${METRICS_WRITE_URL} METRICS_WRITE_URL: ${METRICS_WRITE_URL}
METRICS_WRITE_TOOL: ${METRICS_WRITE_TOOL} METRICS_WRITE_TOOL: ${METRICS_WRITE_TOOL}
METRIC_WRITE_SOURCE: ${METRIC_WRITE_SOURCE} METRICS_WRITE_SOURCE: ${METRICS_WRITE_SOURCE}
METRICS_WRITE_USERNAME: ${METRICS_WRITE_USERNAME} METRICS_WRITE_USERNAME: ${METRICS_WRITE_USERNAME}
METRICS_WRITE_PASSWORD: ${METRICS_WRITE_PASSWORD} METRICS_WRITE_PASSWORD: ${METRICS_WRITE_PASSWORD}
METAMASK_PLAYWRIGHT_RUN_HEADLESS: ${METAMASK_PLAYWRIGHT_RUN_HEADLESS} METAMASK_PLAYWRIGHT_RUN_HEADLESS: ${METAMASK_PLAYWRIGHT_RUN_HEADLESS}
......
...@@ -7,7 +7,7 @@ WORKDIR /app ...@@ -7,7 +7,7 @@ WORKDIR /app
# Update PATH # Update PATH
ENV PATH /app/node_modules/.bin:$PATH ENV PATH /app/node_modules/.bin:$PATH
RUN if [ "$METAMASK_RUN_HEADLESS" != "false" ]; then \ RUN if [ "$METAMASK_PLAYWRIGHT_RUN_HEADLESS" != "false" ]; then \
apt-get update && \ apt-get update && \
apt-get install -y xvfb && \ apt-get install -y xvfb && \
rm -rf /var/lib/apt/lists/* ; \ rm -rf /var/lib/apt/lists/* ; \
......
...@@ -22,7 +22,7 @@ jobs: ...@@ -22,7 +22,7 @@ jobs:
METRICS_READ_PASSWORD: ${{ secrets.METRICS_READ_PASSWORD }} METRICS_READ_PASSWORD: ${{ secrets.METRICS_READ_PASSWORD }}
METRICS_WRITE_URL: ${{ secrets.METRICS_WRITE_URL }} METRICS_WRITE_URL: ${{ secrets.METRICS_WRITE_URL }}
METRICS_WRITE_TOOL: ${{ secrets.METRICS_WRITE_TOOL }} METRICS_WRITE_TOOL: ${{ secrets.METRICS_WRITE_TOOL }}
METRIC_WRITE_SOURCE: ${{ secrets.METRIC_WRITE_SOURCE }} METRICS_WRITE_SOURCE: ${{ secrets.METRICS_WRITE_SOURCE }}
METRICS_WRITE_USERNAME: ${{ secrets.METRICS_WRITE_USERNAME }} METRICS_WRITE_USERNAME: ${{ secrets.METRICS_WRITE_USERNAME }}
METRICS_WRITE_PASSWORD: ${{ secrets.METRICS_WRITE_PASSWORD }} METRICS_WRITE_PASSWORD: ${{ secrets.METRICS_WRITE_PASSWORD }}
METAMASK_SECRET_WORDS_OR_PRIVATEKEY: ${{ secrets.METAMASK_SECRET_WORDS_OR_PRIVATEKEY }} METAMASK_SECRET_WORDS_OR_PRIVATEKEY: ${{ secrets.METAMASK_SECRET_WORDS_OR_PRIVATEKEY }}
......
#!/bin/bash #!/bin/bash
if [ "$METAMASK_RUN_HEADLESS" == "true" ]; then if [ "$METAMASK_PLAYWRIGHT_RUN_HEADLESS" != "false" ]; then
# Start Xvfb in the background on display :99 # Start Xvfb in the background on display :99
Xvfb :99 & Xvfb :99 &
......
...@@ -9,7 +9,7 @@ const env = z ...@@ -9,7 +9,7 @@ const env = z
METRICS_READ_PASSWORD: z.string().optional(), METRICS_READ_PASSWORD: z.string().optional(),
METRICS_WRITE_URL: z.string().url(), METRICS_WRITE_URL: z.string().url(),
METRICS_WRITE_TOOL: z.enum(['grafana', 'prometheus-pushgateway']), METRICS_WRITE_TOOL: z.enum(['grafana', 'prometheus-pushgateway']),
METRIC_WRITE_SOURCE: z.string().optional(), METRICS_WRITE_SOURCE: z.string().optional(),
METRICS_WRITE_USERNAME: z.string().optional(), METRICS_WRITE_USERNAME: z.string().optional(),
METRICS_WRITE_PASSWORD: z.string().optional(), METRICS_WRITE_PASSWORD: z.string().optional(),
}) })
...@@ -40,7 +40,7 @@ const env = z ...@@ -40,7 +40,7 @@ const env = z
(data) => { (data) => {
if ( if (
data.METRICS_WRITE_TOOL === 'grafana' && data.METRICS_WRITE_TOOL === 'grafana' &&
data.METRIC_WRITE_SOURCE === undefined data.METRICS_WRITE_SOURCE === undefined
) )
return false return false
...@@ -48,7 +48,7 @@ const env = z ...@@ -48,7 +48,7 @@ const env = z
}, },
{ {
message: message:
'Writing to Grafana requires a source, please specify one using METRIC_WRITE_SOURCE env', 'Writing to Grafana requires a source, please specify one using METRICS_WRITE_SOURCE env',
} }
) )
.parse(process.env) .parse(process.env)
...@@ -164,7 +164,7 @@ export const getSelfSendGaugeValue = async () => { ...@@ -164,7 +164,7 @@ export const getSelfSendGaugeValue = async () => {
const pushMetricsGrafana = (metricName: string, valueToSetTo: number) => const pushMetricsGrafana = (metricName: string, valueToSetTo: number) =>
pushMetricsWriteUrl( pushMetricsWriteUrl(
`${metricName},source=${ `${metricName},source=${
env.METRIC_WRITE_SOURCE env.METRICS_WRITE_SOURCE
} metric=${valueToSetTo}` } metric=${valueToSetTo}`
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment