diff --git a/local_build.sh b/local_build.sh new file mode 100644 index 00000000..a2f4ed08 --- /dev/null +++ b/local_build.sh @@ -0,0 +1,2 @@ +buildah build --format=docker -f pipeline/workflow-builder.Dockerfile -t quay.io/gfarache/serverless-workflow-move2kube:test --build-arg WF_RESOURCES=move2kube/ --build-arg QUARKUS_ADD_EXTENSIONS_ARGS=org.kie.kogito:kogito-addons-quarkus-jobs-knative-eventing:999-SNAPSHOT --ulimit nofile=4096:4096 . && \ +buildah push quay.io/gfarache/serverless-workflow-move2kube:test \ No newline at end of file diff --git a/move2kube/m2k.sw.yml b/move2kube/m2k.sw.yml index 3458d9df..4e799a9c 100644 --- a/move2kube/m2k.sw.yml +++ b/move2kube/m2k.sw.yml @@ -12,6 +12,9 @@ events: - name: transformationSavedEvent source: '' type: transformation_saved + - name: saveTransformationEvent + source: '' + type: save-transformation functions: - name: systemOut type: custom @@ -25,9 +28,6 @@ functions: - name: startTransformation type: rest operation: specs/move2kube.yaml#start-transformation - - name: sendCloudEvent - type: custom - operation: rest:post:http://broker-ingress.knative-eventing.svc.cluster.local/sonataflow-infra/default - name: createNotification operation: 'specs/notifications.yaml#createNotification' states: @@ -99,37 +99,18 @@ states: actions: - title: "Move2Kube waiting Q&A" url: "$SECRET.move2kube_url + \"/workspaces/\"+ .workspaceId + \"/projects/\" + .projectId + \"/outputs/\"+ .transformId " - transition: SaveTransformationOutput - - name: SaveTransformationOutput - type: operation - actions: - - functionRef: - refName: sendCloudEvent - arguments: - HEADER_Ce-Id: $WORKFLOW.instanceId - HEADER_Ce-Specversion: "1.0" - HEADER_Ce-Type: "save-transformation" - HEADER_Ce-Source: "m2k_swf" - HEADER_Content-Type: "application/json" - gitRepo: "(.repositoryURL|sub(\"http(s)?://\";\"ssh://\"))" - branch: .targetBranch - token: .token - workspaceId: .workspaceId - projectId: .projectId - transformId: .transformId - workflowCallerId: $WORKFLOW.instanceId - transition: WaitForSaveTransformationCompletion - - name: WaitForSaveTransformationCompletion + transition: + nextState: WaitForSaveTransformationCompletionEvent + produceEvents: + - eventRef: saveTransformationEvent + data: '${{"gitRepo":".repositoryURL", "branch": ".targetBranch", "token": ".token", "workspaceId": ".workspaceId", "projectId": ".projectId", "transformId": ".transformId ", "workflowCallerId": "$WORKFLOW.instanceId"}}' + - name: WaitForSaveTransformationCompletionEvent type: switch eventConditions: - - eventRef: transformationSavedEvent - transition: TransformationSaved - eventRef: errorEvent transition: TransformationError - defaultCondition: - transition: TransformationError - timeouts: - eventTimeout: PT3M + - eventRef: transformationSavedEvent + transition: TransformationSaved - name: TransformationSaved type: inject data: diff --git a/pipeline/workflow-builder.Dockerfile b/pipeline/workflow-builder.Dockerfile index 3ed17888..3c79c1e3 100644 --- a/pipeline/workflow-builder.Dockerfile +++ b/pipeline/workflow-builder.Dockerfile @@ -1,4 +1,4 @@ -FROM quay.io/kiegroup/kogito-swf-builder-nightly:main-2024-01-24 AS builder +FROM quay.io/kiegroup/kogito-swf-builder-nightly:main-2024-01-29 AS builder # variables that can be overridden by the builder # To add a Quarkus extension to your application