Skip to content

Commit

Permalink
Merge pull request #48 from parodos-dev/autopr-27289
Browse files Browse the repository at this point in the history
Automatic manifests generation from
  • Loading branch information
masayag authored Jan 30, 2024
2 parents 692f9a4 + 6695617 commit 63fa9a3
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1839,13 +1839,6 @@ data:
summary: Create notification
description: Create notification
operationId: createNotification
parameters:
- name: notifications-secret
in: header
description: Notification secret
required: true
schema:
type: string
requestBody:
description: Create a new notification
content:
Expand Down Expand Up @@ -2060,11 +2053,29 @@ data:
type: string
message:
type: string
actions:
type: array
items:
type: object
properties:
title:
type: string
url:
type: string
required: [title, url]
topic:
type: string
targetUsers:
type: array
items:
type: string
targetGroups:
type: array
items:
type: string
required: [origin, title]
kind: ConfigMap
metadata:
creationTimestamp: null
name: 01-{{ .Values.workflow.name }}-resources
namespace: {{ .Values.namespace }}
name: 01-m2k-resources
namespace: default
36 changes: 21 additions & 15 deletions charts/workflows/charts/move2kube/templates/01-sonataflow_m2k.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ apiVersion: sonataflow.org/v1alpha08
kind: SonataFlow
metadata:
annotations:
sonataflow.org/description: Workflow to execute {{ .Values.workflow.name }}
sonataflow.org/description: Workflow to execute Move2Kube
sonataflow.org/expressionLang: jq
sonataflow.org/version: "1.0"
creationTimestamp: null
labels:
app: {{ .Values.workflow.name }}
sonataflow.org/workflow-app: {{ .Values.workflow.name }}
name: {{ .Values.workflow.name }}
namespace: {{ .Values.namespace }}
app: m2k
sonataflow.org/workflow-app: m2k
name: m2k
namespace: default
spec:
flow:
dataInputSchema:
Expand Down Expand Up @@ -123,10 +123,13 @@ spec:
actions:
- actionDataFilter:
useResults: true
condition: ((has("notifications_disabled") and .notifications_disabled != null and .notifications_disabled == true)|not)
condition: ((has("notificationsDisabled") and .notificationsDisabled != null and .notificationsDisabled == true)|not)
functionRef:
arguments:
message: '"Please go to your <a href=\"" + $SECRET.move2kube_url + "/workspaces/"+ .workspaceId + "/projects/" + .projectId + "/outputs/"+ .transformId + "\">Move2Kube instance</a> and answers to questions in order to continue the Move2Kube workflow"'
actions:
- title: Move2Kube waiting Q&A
url: '$SECRET.move2kube_url + "/workspaces/"+ .workspaceId + "/projects/" + .projectId + "/outputs/"+ .transformId '
message: '"Please go to your move2kube instance and answer the questions in order to continue the Move2Kube workflow"'
origin: Move2Kube Workflow
title: ' "Transformation " + .transformationId + " waiting for Q&A" '
topic: Move2Kube Workflow
Expand All @@ -149,7 +152,7 @@ spec:
HEADER_Ce-Type: save-transformation
HEADER_Content-Type: application/json
branch: .targetBranch
gitRepo: (.repositoryURL|sub(\"http(s)?://\";\"ssh://\"))
gitRepo: (.repositoryURL|sub("http(s)?://";"ssh://"))
projectId: .projectId
token: .token
transformId: .transformId
Expand Down Expand Up @@ -201,10 +204,10 @@ spec:
- actions:
- actionDataFilter:
useResults: true
condition: ((has("notifications_disabled") and .notifications_disabled != null and .notifications_disabled == true)|not)
condition: ((has("notificationsDisabled") and .notificationsDisabled != null and .notificationsDisabled == true)|not)
functionRef:
arguments:
message: '"Move2Kube workflow " + $WORKFLOW.instanceId + " on workspace " + .workspaceId + " and project " + .projectId + " failed with exit message: "+ .exitMessage + " <br><br>Error: " + .error'
message: '"Move2Kube workflow " + $WORKFLOW.instanceId + " on workspace " + .workspaceId + " and project " + .projectId + " failed with exit message: "+ .exitMessage + "\n\nError: " + .error'
origin: Move2Kube Workflow
title: '"Move2Kube workflow " + $WORKFLOW.instanceId + " failed"'
topic: Move2Kube Workflow
Expand Down Expand Up @@ -232,11 +235,11 @@ spec:
- actions:
- actionDataFilter:
useResults: true
condition: ((has("notifications_disabled") and .notifications_disabled != null and .notifications_disabled == true)|not)
condition: ((has("notificationsDisabled") and .notificationsDisabled != null and .notificationsDisabled == true)|not)
functionRef:
arguments:
message: '"Move2Kube workflow " + $WORKFLOW.instanceId + " on workspace " + .workspaceId + " and project " + .projectId + " was successful"'
origin: Move2Kube Worflow
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"'
origin: Move2Kube Workflow
title: '"Move2Kube workflow " + $WORKFLOW.instanceId + " success"'
topic: Move2Kube Workflow
invoke: sync
Expand All @@ -252,9 +255,12 @@ spec:
podTemplate:
container:
resources: {}
image: {{ .Values.workflow.image }}
image: quay.io/orchestrator/serverless-workflow-move2kube:4fae4bd85a48f4091f5c67a83fbcc94dcd29f1f2
resources:
configMaps:
- configMap:
name: 01-{{ .Values.workflow.name }}-resources
name: 01-m2k-resources
workflowPath: specs
status:
address: {}
lastTimeRecoverAttempt: null
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ data:
mp.messaging.incoming.kogito_incoming_stream.path=/
mp.messaging.incoming.kogito_incoming_stream.method=POST
move2kube_url={{ .Values.workflow.move2kubeURL }}
quarkus.rest-client.move2kube_yaml.url={{ .Values.workflow.move2kubeURL }}
quarkus.rest-client.notifications_yaml.url={{ .Values.workflow.backstageNotificationURL }}
# This property is used when sending the notification while waiting for Q&A
move2kube_url=${MOVE2KUBE_URL:http://move2kube-svc.default.svc.cluster.local:8080}
# This property is used to send requests to the move2kube instance
quarkus.rest-client.move2kube_yaml.url=${MOVE2KUBE_URL:http://move2kube-svc.default.svc.cluster.local:8080}
# This property is used to send requests to the backstage notification plugin
quarkus.rest-client.notifications_yaml.url=${BACKSTAGE_NOTIFICATIONS_URL:http://orchestrator-backstage.orchestrator/api/notifications/}
kind: ConfigMap
metadata:
creationTimestamp: null
labels:
app: {{ .Values.workflow.name }}
sonataflow.org/workflow-app: {{ .Values.workflow.name }}
name: {{ .Values.workflow.name }}-props
namespace: {{ .Values.namespace }}
app: m2k
sonataflow.org/workflow-app: m2k
name: m2k-props
namespace: default

0 comments on commit 63fa9a3

Please sign in to comment.