Skip to content

Commit

Permalink
only use /scratch if it exists
Browse files Browse the repository at this point in the history
turns out we use this in the GitHub Actions too, which don't have
/scratch

Signed-off-by: Alex Suraci <[email protected]>
  • Loading branch information
vito committed Jan 4, 2021
1 parent 6176ced commit 579cc81
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cmd/task/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ func main() {
}
}

buildkitd, err := task.SpawnBuildkitd(req, &task.BuildkitdOpts{
RootDir: "/scratch/buildkitd",
})
var opts task.BuildkitdOpts
if _, err := os.Stat("/scratch"); err == nil {
opts.RootDir = "/scratch/buildkitd"
}

buildkitd, err := task.SpawnBuildkitd(req, &opts)
failIf("start buildkitd", err)

res, err := task.Build(buildkitd, wd, req)
Expand Down

0 comments on commit 579cc81

Please sign in to comment.