Feat v0.7.2 package runners ci gate (#56)
All checks were successful
CI/CD / detect-changes (push) Successful in 4s
CI/CD / test-runners (push) Has been skipped
CI/CD / test-frontend (push) Successful in 6s
CI/CD / test-go-pg (push) Successful in 2m39s
CI/CD / test-sqlite (push) Successful in 2m55s
CI/CD / build-and-deploy (push) Successful in 29s
All checks were successful
CI/CD / detect-changes (push) Successful in 4s
CI/CD / test-runners (push) Has been skipped
CI/CD / test-frontend (push) Successful in 6s
CI/CD / test-go-pg (push) Successful in 2m39s
CI/CD / test-sqlite (push) Successful in 2m55s
CI/CD / build-and-deploy (push) Successful in 29s
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com> Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #56.
This commit is contained in:
@@ -253,6 +253,23 @@ func InstallWorkflowFromManifest(ctx *gin.Context, stores store.Stores, pkgID st
|
||||
}
|
||||
}
|
||||
|
||||
// Publish version 1 (snapshot of stages) and activate the workflow
|
||||
// so it's immediately usable after install.
|
||||
stages, _ := stores.Workflows.ListStages(reqCtx, workflowID)
|
||||
snapshot, _ := json.Marshal(stages)
|
||||
ver := &models.WorkflowVersion{
|
||||
WorkflowID: workflowID,
|
||||
VersionNumber: 1,
|
||||
Snapshot: snapshot,
|
||||
}
|
||||
if err := stores.Workflows.Publish(reqCtx, ver); err != nil {
|
||||
log.Printf("[workflow-pkg] failed to publish version for %s: %v", pkgID, err)
|
||||
}
|
||||
active := true
|
||||
if err := stores.Workflows.Update(reqCtx, workflowID, models.WorkflowPatch{IsActive: &active}); err != nil {
|
||||
log.Printf("[workflow-pkg] failed to activate %s: %v", pkgID, err)
|
||||
}
|
||||
|
||||
// Store workflow_id in package_settings for reference
|
||||
settingsJSON, _ := json.Marshal(map[string]string{"workflow_id": workflowID})
|
||||
stores.Packages.SetPackageSettings(reqCtx, pkgID, json.RawMessage(settingsJSON))
|
||||
|
||||
Reference in New Issue
Block a user