UpdateAppRunScript reads the run.template file, replaces {{ENTRYPOINT}} with the provided webCmd, populates the Runit envdir with exported environment variables, and writes the executable app/run script.
(serviceDir, webCmd string, envVars map[string]string)
| 25 | // UpdateAppRunScript reads the run.template file, replaces {{ENTRYPOINT}} with the provided webCmd, |
| 26 | // populates the Runit envdir with exported environment variables, and writes the executable app/run script. |
| 27 | func UpdateAppRunScript(serviceDir, webCmd string, envVars map[string]string) error { |
| 28 | if err := updateEnvDir(serviceDir, envVars); err != nil { |
| 29 | return err |
| 30 | } |
| 31 | if err := renderRunScript(serviceDir, webCmd); err != nil { |
| 32 | return err |
| 33 | } |
| 34 | return nil |
| 35 | } |
| 36 | |
| 37 | func updateEnvDir(serviceDir string, envVars map[string]string) error { |
| 38 | envDir := filepath.Join(serviceDir, "app", "env") |