Skip to content

Commit

Permalink
feat: support sbt accelerate
Browse files Browse the repository at this point in the history
  • Loading branch information
hyy0322 committed Sep 3, 2020
1 parent e039aab commit cb04752
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
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

0 comments on commit cb04752

Please sign in to comment.