feat(secrets): send secrets to bash and ansible

This commit is contained in:
fiftin 2024-07-03 01:18:30 +05:00
parent 46048ef770
commit 2db419357e
No known key found for this signature in database
GPG Key ID: 044381366A5D4731

View File

@ -183,6 +183,10 @@ func (t *LocalJob) getBashArgs(username string, incomingVersion *string) (args [
args = append(args, fmt.Sprintf("%s=%s", name, value))
}
for _, secret := range t.Environment.Secrets {
args = append(args, fmt.Sprintf("%s=%s", secret.Name, secret.Secret))
}
return
}
@ -306,6 +310,10 @@ func (t *LocalJob) getPlaybookArgs(username string, incomingVersion *string) (ar
args = append(args, "--extra-vars", extraVars)
}
for _, secret := range t.Environment.Secrets {
args = append(args, "--extra-vars", fmt.Sprintf("%s=%s", secret.Name, secret.Secret))
}
var templateExtraArgs []string
if t.Template.Arguments != nil {
err = json.Unmarshal([]byte(*t.Template.Arguments), &templateExtraArgs)