Add git provenance labels

as per #1290

Signed-off-by: Christian Dupuis <cd@atomist.com>
This commit is contained in:
Christian Dupuis
2022-08-20 12:25:44 +02:00
parent 1bb375fe5c
commit e3c91c9d29
3 changed files with 225 additions and 0 deletions

View File

@ -786,6 +786,18 @@ func BuildWithResultHandler(ctx context.Context, drivers []DriverInfo, opt map[s
eg, ctx := errgroup.WithContext(ctx)
for _, opt := range opt {
gitLabels, err := addGitProvenance(ctx, opt.Inputs.ContextPath, opt.Inputs.DockerfilePath)
if err != nil {
return nil, err
}
for n, v := range gitLabels {
if _, ok := opt.Labels[n]; !ok {
opt.Labels[n] = v
}
}
}
for k, opt := range opt {
multiDriver := len(m[k]) > 1
hasMobyDriver := false