esgf2-us / metagrid

ESGF Search UI
https://metagrid.readthedocs.io/en/latest/
MIT License
16 stars 4 forks source link

Adds frontend runtime env #556

Closed jasonb5 closed 11 months ago

jasonb5 commented 12 months ago

Description

This PR adds runtime configuration to the frontend.

The priority is environment variables followed by values loaded from ENV_FILE, which defaults to /env.

This works by reading ENV_FILE overwriting anything with environment variables and writing /usr/share/nginx/html/static/js/runtime_env.js. This js file provides the variables to the frontend via windows.ENV. The frontend will read these values if present or default to reading from process.env.

Fixes # (issue)

Type of change

How Has This Been Tested?

Checklist

codecov[bot] commented 12 months ago

Codecov Report

Merging #556 (4efb770) into v1.0.10 (db810a6) will not change coverage. The diff coverage is n/a.

@@            Coverage Diff            @@
##           v1.0.10      #556   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           30        30           
  Lines          854       854           
=========================================
  Hits           854       854           
Flag Coverage Δ
backend 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

jasonb5 commented 11 months ago

Merged to #561