Skip to content

Commit

Permalink
perf: add build static cache
Browse files Browse the repository at this point in the history
Signed-off-by: 张启航 <[email protected]>
  • Loading branch information
ZhangSetSail committed Feb 29, 2024
1 parent d5ea0a7 commit abc6088
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions builder/build/code_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ func (s *slugBuild) createVolumeAndMount(re *Request, sourceTarFileName string,
Name: "cache",
MountPath: "/tmp/cache",
})
volumeMounts = append(volumeMounts, corev1.VolumeMount{
Name: "cache",
MountPath: "/tmp/build/node_modules",
})
}
} else {
volumes = []corev1.Volume{
Expand Down Expand Up @@ -377,6 +381,9 @@ func (s *slugBuild) runBuildJob(re *Request) error {
if k == "NO_CACHE" && v == "True" {
buildNoCache = true
}
if k == "NODE_MODULES_CACHE" && v == "True" {
buildNoCache = true
}
}
podSpec := corev1.PodSpec{
RestartPolicy: corev1.RestartPolicyOnFailure,
Expand Down

0 comments on commit abc6088

Please sign in to comment.