From 47e2e1099be1b48ed9380e23824fbcf88f456e2f Mon Sep 17 00:00:00 2001 From: gabriel-farache Date: Thu, 18 Jan 2024 09:37:33 +0100 Subject: [PATCH 1/2] Use standard event producer --- move2kube/m2k.sw.yml | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/move2kube/m2k.sw.yml b/move2kube/m2k.sw.yml index 0992bf3c..b3a00619 100644 --- a/move2kube/m2k.sw.yml +++ b/move2kube/m2k.sw.yml @@ -12,6 +12,10 @@ events: - name: transformationSavedEvent source: '' type: transformation_saved + - name: saveTransformation + source: m2k_swf + type: save-transformation + kind: produced functions: - name: systemOut type: custom @@ -98,23 +102,18 @@ states: topic: "Move2Kube Workflow" 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: '"ssh://" + .repositoryURL' - branch: .targetBranch - token: .token - workspaceId: .workspaceId - projectId: .projectId - transformId: .transformId - workflowCallerId: $WORKFLOW.instanceId + type: inject + data: + gitRepo: '"ssh://" + .repositoryURL' + branch: .targetBranch + token: .token + workspaceId: .workspaceId + projectId: .projectId + transformId: .transformId + workflowCallerId: $WORKFLOW.instanceId + end: + produceEvents: + - eventRef: saveTransformation transition: WaitForSaveTransformationCompletion - name: WaitForSaveTransformationCompletion type: switch From e9555203a1a89b37af01f0291fe6e9998795ad10 Mon Sep 17 00:00:00 2001 From: gabriel-farache Date: Thu, 18 Jan 2024 09:40:42 +0100 Subject: [PATCH 2/2] Replace https from repo url to ssh for MTA compliance --- move2kube/m2k.sw.yml | 4 ++-- move2kube/schemas/input.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/move2kube/m2k.sw.yml b/move2kube/m2k.sw.yml index b3a00619..aa1053ec 100644 --- a/move2kube/m2k.sw.yml +++ b/move2kube/m2k.sw.yml @@ -43,7 +43,7 @@ states: arguments: workspace-id: ".workspaceId" project-id: ".projectId" - remote-source: "\"git+ssh://\" + .repositoryURL + \"@\" + .sourceBranch" + remote-source: "\"git+\" + (.repositoryURL|sub(\"http(s)://?\";\"ssh://\")) + \"@\" + .sourceBranch" transition: GetPlanning - name: GetPlanning type: operation @@ -104,7 +104,7 @@ states: - name: SaveTransformationOutput type: inject data: - gitRepo: '"ssh://" + .repositoryURL' + gitRepo: (.repositoryURL|sub(\"http(s)?://\";\"ssh://\")) branch: .targetBranch token: .token workspaceId: .workspaceId diff --git a/move2kube/schemas/input.json b/move2kube/schemas/input.json index 3604e046..bceb7af3 100644 --- a/move2kube/schemas/input.json +++ b/move2kube/schemas/input.json @@ -9,7 +9,7 @@ "description": "the git repository URL to be used", "type": "string", "examples": [ - "bitbucket.org/gfarache31/m2k-test" + "https://bitbucket.org/gfarache31/m2k-test" ] }, "sourceBranch": {