Search…
⌃K
Links

Environment variable mappings

Why and how to use environment variable mappings
There are many reasons you may want to use environment variables in your application, for example, to provide a backend URL for your frontend.
Here is an example config.js for a React application:
export default {
API: process.env.REACT_APP_BACKEND_BASE_URL,
FRONTEND_URL: process.env.REACT_APP_FRONTEND_BASE_URL
};
In this example, ReleaseHub will autogenerate ingress URLs for the application to expose ports:
- key: BACKEND_INGRESS_URL
value: https://api.releaseapp.io
- key: FRONTEND_INGRESS_URL
value: https://app.releaseapp.io
In order for the frontend application to use the URLs autogenerated by ReleaseHub, you can map the application's environment variables to the autogenerated environment variables. You can map environment variables in an application's default environment variables or in the environment-specific environment variables.
Here is an example environment variable mapping:
mapping:
REACT_APP_BACKEND_BASE_URL: BACKEND_INGRESS_URL
REACT_APP_FRONTEND_BASE_URL: FRONTEND_INGRESS_URL
Mappings are expressed as key-value pairs, with the application's environment variable as the key and the ReleaseHub autogenerated environment variable as the value.
Once you have added your environment variable mapping, save the configuration and deploy.