Skip to content

Commit

Permalink
feat: add job build image capability
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurcgc committed Oct 17, 2023
1 parent 3dccc1c commit c5b414b
Show file tree
Hide file tree
Showing 4 changed files with 243 additions and 118 deletions.
8 changes: 8 additions & 0 deletions pkg/build/buildkit/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ func (b *BuildKit) Build(ctx context.Context, r *pb.BuildRequest, w io.Writer) (
case "BUILD_KIND_APP_BUILD_WITH_CONTAINER_IMAGE":
return b.buildFromContainerImage(ctx, c, r, ow)

case "BUILD_KIND_JOB_CREATE_WITH_CONTAINER_IMAGE":
return b.buildFromContainerImage(ctx, c, r, ow)

case "BUILD_KIND_APP_BUILD_WITH_CONTAINER_FILE":
return b.buildFromContainerFile(ctx, c, r, ow)

Expand Down Expand Up @@ -418,6 +421,11 @@ func callBuildKitBuild(ctx context.Context, c *client.Client, buildContextDir st
ID: "tsuru-app-envvars",
FilePath: filepath.Join(buildContextDir, "secrets", "envs.sh"),
})
} else if r.Job != nil {
secretSources = append(secretSources, secretsprovider.Source{
ID: "tsuru-job-envvars",
FilePath: filepath.Join(buildContextDir, "secrets", "envs.sh"),
})
}

secrets, err := secretsprovider.NewStore(secretSources)
Expand Down
Loading

0 comments on commit c5b414b

Please sign in to comment.