MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/buildpacks / UpdateAppRunScript

Function UpdateAppRunScript

pkg/devsync/devsync.go:27–35  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
27func 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
37func updateEnvDir(serviceDir string, envVars map[string]string) error {
38 envDir := filepath.Join(serviceDir, "app", "env")

Callers 2

TestUpdateAppRunScriptFunction · 0.85

Calls 2

updateEnvDirFunction · 0.85
renderRunScriptFunction · 0.85

Tested by 1

TestUpdateAppRunScriptFunction · 0.68