Workspaces: Inject domain template as an environment variable
MR: Add workspace domain as environment variable (!123907 - merged)
Description
As a user, I want to get the start a server within my workspace and get it's accessible URL within the workspace so that I can use it in my scripts within the workspace.
Example: For GDK, to get a rails app up and running in a remote workspace, rails needs to know what URLs to generate. Currently within the workspace, there's no (obvious) way to get that.
Proposal
Acceptance Criteria
-
Environment variable whose value is the domain template(port value will be a template)
Technical Requirements
We do not give any guarantees on the way the URL is structured. Right now the port is at the front but we might decide to move it at the end of the URL. Also, since we are at very early stages, we are not yet sure what all environment variables we would like to inject into the workspace(and support in the future) and thus reducing it to the minimum things.
Add an environment variable whose value is the domain with the port value templatized so that users can render and get the required url by doing something like
URL=$(echo $GL_WORKSPACE_DOMAIN_TEMPLATE | sed -r 's/\${PORT}/123/')
Impact Assessment
Since GL_WORKSPACE_DOMAIN_TEMPLATE
is the domain on which the workspace is available, if we decide to allow users to change dns_zone in the agent configuration, this environment variable would have to be updated into the workspace(by restarting the workspace)
Availability and Testing
Ensure updated test coverage in e2e tests.