Added more descriptive features to workflows

This commit is contained in:
frikky
2021-05-04 17:35:03 +02:00
parent 3a8b61510b
commit 16d034b8e2
7 changed files with 723 additions and 149 deletions
+20 -2
View File
@@ -5181,16 +5181,34 @@ func runInit(ctx context.Context) {
log.Printf("Failed setting up new environment")
}
} else if len(activeOrgs) == 1 {
log.Printf("Setting up all environments with org %s", activeOrgs[0].Id)
log.Printf("[INFO] Setting up all environments with org %s", activeOrgs[0].Id)
var environments []shuffle.Environment
q := datastore.NewQuery("Environments")
_, err = dbclient.GetAll(ctx, q, &environments)
if err == nil {
existingEnv := []string{}
_ = existingEnv
for _, item := range environments {
if item.OrgId == activeOrgs[0].Id {
//if shuffle.ArrayContains(existingEnv, item.Name) {
// log.Printf("[WARNING] Env %s already exists - deleting it. %#v", item.Name, item)
// err = DeleteKey(ctx, "Environments", item.Name)
// if err != nil {
// log.Printf("[WARNING] Env deletion error: %s", err)
// }
// continue
//}
//existingEnv = append(existingEnv, item.Name)
if item.OrgId == activeOrgs[0].Id && len(item.Id) > 0 {
continue
}
if len(item.Id) == 0 {
item.Id = uuid.NewV4().String()
}
item.OrgId = activeOrgs[0].Id
err = setEnvironment(ctx, &item)
if err != nil {