MCPcopy Index your code
hub / github.com/cloudfoundry/java-buildpack / Run

Function Run

src/java/finalize/finalize.go:71–131  ·  view source on GitHub ↗

Run performs the finalize phase

(f *Finalizer)

Source from the content-addressed store, hash-verified

69
70// Run performs the finalize phase
71func Run(f *Finalizer) error {
72 f.Log.BeginStep("Finalizing Java")
73
74 ctx := &common.Context{
75 Stager: f.Stager,
76 Manifest: f.Manifest,
77 Installer: f.Installer,
78 Log: f.Log,
79 Command: f.Command,
80 }
81
82 // Resolve container using the name stored by supply — no re-detection needed.
83 container, err := resolveContainer(ctx, f.ContainerName)
84 if err != nil {
85 f.Log.Error("Failed to resolve container %q: %s", f.ContainerName, err.Error())
86 return err
87 }
88 f.Container = container
89
90 f.Log.Info("Finalizing container: %s", f.ContainerName)
91 // Resolve JRE using the name stored by supply — no re-detection needed.
92 jre, err := resolveJRE(ctx, f.JREName)
93 if err != nil {
94 f.Log.Error("Failed to resolve JRE %q: %s", f.JREName, err.Error())
95 return err
96 }
97 f.JRE = jre
98
99 // Finalize JRE (memory calculator, jvmkill, etc.)
100 if err := f.finalizeJRE(); err != nil {
101 f.Log.Error("Failed to finalize JRE: %s", err.Error())
102 return err
103 }
104
105 // Finalize frameworks (APM agents, etc.)
106 if err := f.finalizeFrameworks(ctx); err != nil {
107 f.Log.Error("Failed to finalize frameworks: %s", err.Error())
108 return err
109 }
110
111 // Call container's finalize method
112 if err := container.Finalize(); err != nil {
113 f.Log.Error("Failed to finalize container: %s", err.Error())
114 return err
115 }
116
117 // Install the javaexec launcher binary used by the start command.
118 if err := f.InstallJavaexecLauncher(); err != nil {
119 f.Log.Error("Failed to install javaexec launcher: %s", err.Error())
120 return err
121 }
122
123 // Write release YAML configuration
124 if err := f.writeReleaseYaml(container); err != nil {
125 f.Log.Error("Failed to write release YAML: %s", err.Error())
126 return err
127 }
128

Callers 2

finalize_test.goFile · 0.92
mainFunction · 0.92

Calls 7

resolveContainerFunction · 0.85
resolveJREFunction · 0.85
finalizeJREMethod · 0.80
finalizeFrameworksMethod · 0.80
writeReleaseYamlMethod · 0.80
FinalizeMethod · 0.65

Tested by

no test coverage detected