GetWebEnvVar gets an environment variable from the web service It returns empty string if there is no var or the ComposeYaml is just not set.
(name string)
| 730 | // It returns empty string if there is no var or the ComposeYaml |
| 731 | // is just not set. |
| 732 | func (app *DdevApp) GetWebEnvVar(name string) string { |
| 733 | if app.ComposeYaml != nil && app.ComposeYaml.Services != nil { |
| 734 | if service, ok := app.ComposeYaml.Services["web"]; ok { |
| 735 | if service.Environment != nil { |
| 736 | if v, ok := service.Environment[name]; ok && v != nil { |
| 737 | return *v |
| 738 | } |
| 739 | } |
| 740 | } |
| 741 | } |
| 742 | return "" |
| 743 | } |
| 744 | |
| 745 | // TargetPortFromExposeVariable uses a string like HTTP_EXPOSE or HTTPS_EXPOSE, which is a |
| 746 | // comma-delimited list of colon-delimited port-pairs |
no outgoing calls
no test coverage detected