| 510 | } |
| 511 | |
| 512 | func toBakeSecrets(project *types.Project, secrets []types.ServiceSecretConfig) ([]string, []string) { |
| 513 | var s []string |
| 514 | var env []string |
| 515 | for _, ref := range secrets { |
| 516 | def := project.Secrets[ref.Source] |
| 517 | target := ref.Target |
| 518 | if target == "" { |
| 519 | target = ref.Source |
| 520 | } |
| 521 | switch { |
| 522 | case def.Environment != "": |
| 523 | env = append(env, fmt.Sprintf("%s=%s", def.Environment, project.Environment[def.Environment])) |
| 524 | s = append(s, fmt.Sprintf("id=%s,type=env,env=%s", target, def.Environment)) |
| 525 | case def.File != "": |
| 526 | s = append(s, fmt.Sprintf("id=%s,type=file,src=%s", target, def.File)) |
| 527 | } |
| 528 | } |
| 529 | return s, env |
| 530 | } |
| 531 | |
| 532 | func toBakeAttest(buildConfig types.BuildConfig) []string { |
| 533 | var attests []string |