Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-farache committed Oct 30, 2024
1 parent 8fbf0b1 commit 9c49651
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,19 @@ data:
"recipients"
]
}
workflow-output-schema.json: |-
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "WorkflowResult",
"description": "Schema of workflow output",
"type": "object",
"properties": {
"result": {
"$ref": "../shared/schemas/workflow-result-schema.json",
"type": "object"
}
}
}
kind: ConfigMap
metadata:
creationTimestamp: null
Expand Down
24 changes: 23 additions & 1 deletion charts/move2kube/templates/04-sonataflow_m2k.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ spec:
- name: formatTransformationErrorExitMessage
operation: '{ exitMessage: "Error while saving transformation output: " + (if .error == null then "timeout exception was thrown." else .error end) }'
type: expression
- name: successResult
operation: '{ "completedWith":"success", "message": "Move2Kube workflow " + $WORKFLOW.instanceId + " on workspace " + .workspaceId + " and project " + .projectId + " was successful; the output is available in the branch " + .targetBranch + " of your git repository "+ .repositoryURL, "outputs": [ { "key":"Git repository", "value": .repositoryURL, "format":"link" }, { "key":"Git branch", "value": .targetBranch } ] }'
type: expression
- name: errorResult
operation: '{ "completedWith":"error", "message": "Move2Kube workflow " + $WORKFLOW.instanceId + " on workspace " + .workspaceId + " and project " + .projectId + " failed ", "outputs":[ { "key":"Exit message", "value": .exitMessage }, { "key":"Plan retries", "value": (.planRetries|tostring), "format":"number" } ] }'
type: expression
start:
stateName: StartPlanning
states:
Expand Down Expand Up @@ -238,6 +244,14 @@ spec:
refName: createNotification
name: createNotification
name: createNotification
- actions:
- actionDataFilter:
useResults: true
functionRef:
invoke: sync
refName: errorResult
name: setOutput
name: setOutput
completionType: allOf
end:
terminate: true
Expand Down Expand Up @@ -272,6 +286,14 @@ spec:
refName: createNotification
name: createNotification
name: createNotification
- actions:
- actionDataFilter:
useResults: true
functionRef:
invoke: sync
refName: successResult
name: setOutput
name: setOutput
completionType: allOf
end:
terminate: true
Expand All @@ -281,7 +303,7 @@ spec:
podTemplate:
container:
resources: {}
image: quay.io/orchestrator/serverless-workflow-move2kube:ebd909018d91e17bc482b98feedc475044070701
image: quay.io/orchestrator/serverless-workflow-move2kube:be3e8e3c8099f475b29a7c67b61c6cb604f8b66c
envFrom:
- secretRef:
name: m2k-creds
Expand Down

0 comments on commit 9c49651

Please sign in to comment.