mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-23 20:35:24 +01:00
feat(secrets): promote env secrets to task
This commit is contained in:
parent
c75e79efad
commit
46048ef770
@ -206,6 +206,10 @@ func (t *LocalJob) getTerraformArgs(username string, incomingVersion *string) (a
|
|||||||
args = append(args, "-var", fmt.Sprintf("%s=%s", name, value))
|
args = append(args, "-var", fmt.Sprintf("%s=%s", name, value))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for _, secret := range t.Environment.Secrets {
|
||||||
|
args = append(args, "-var", fmt.Sprintf("%s=%s", secret.Name, secret.Secret))
|
||||||
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -274,6 +274,24 @@ func (t *TaskRunner) populateDetails() error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
var secrets []db.AccessKey
|
||||||
|
secrets, err = t.pool.store.GetEnvironmentSecrets(t.Template.ProjectID, *t.Template.EnvironmentID)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, s := range secrets {
|
||||||
|
err = s.DeserializeSecret()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
t.Environment.Secrets = append(t.Environment.Secrets, db.EnvironmentSecret{
|
||||||
|
ID: s.ID,
|
||||||
|
Name: s.Name,
|
||||||
|
Secret: s.String,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if t.Task.Environment != "" {
|
if t.Task.Environment != "" {
|
||||||
|
Loading…
Reference in New Issue
Block a user