Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support sbt accelerate #1481

Merged
merged 1 commit into from
Sep 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions pkg/server/biz/accelerator/accelerate.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ func NewAccelerator(tenant, project string, wfr *v1alpha1.WorkflowRun) *Accelera
// - '/root/.m2' maven dependency path
// - '/root/.gradle' gradle dependency path
// - '/root/.npm' npm dependency path
// - '/root/.ivy2' sbt default dependency cache path
// - '/root/.cache' coursier is a dependency resolver, this is coursier default dependency path
func (a *Accelerator) Accelerate() {
if !a.allowed() {
return
Expand All @@ -70,6 +72,16 @@ func (a *Accelerator) Accelerate() {
Path: fmt.Sprintf("%s/%s/npm", common.CachePrefixPath, a.project),
MountPath: "/root/.npm",
},
{
Type: v1alpha1.PresetVolumeTypePVC,
Path: fmt.Sprintf("%s/%s/sbt/cache", common.CachePrefixPath, a.project),
MountPath: "/root/.cache",
},
{
Type: v1alpha1.PresetVolumeTypePVC,
Path: fmt.Sprintf("%s/%s/sbt/ivy2", common.CachePrefixPath, a.project),
MountPath: "/root/.ivy2",
},
}...)
}
}
Expand Down
10 changes: 10 additions & 0 deletions pkg/server/biz/accelerator/accelerate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ func TestAccelerate(t *testing.T) {
Path: fmt.Sprintf("%s/%s/npm", common.CachePrefixPath, project),
MountPath: "/root/.npm",
},
{
Type: v1alpha1.PresetVolumeTypePVC,
Path: fmt.Sprintf("%s/%s/sbt/cache", common.CachePrefixPath, project),
MountPath: "/root/.cache",
},
{
Type: v1alpha1.PresetVolumeTypePVC,
Path: fmt.Sprintf("%s/%s/sbt/ivy2", common.CachePrefixPath, project),
MountPath: "/root/.ivy2",
},
},
},
},
Expand Down