-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevfile.yaml
More file actions
78 lines (78 loc) · 2.29 KB
/
devfile.yaml
File metadata and controls
78 lines (78 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
schemaVersion: 2.2.2
metadata:
name: workshop-nodejs-using_cloudevents_with_knative
version: 1.0.0
description: Building a CloudEvents Transaction Chain with Node.js
attributes:
che-editor: vscode
components:
- name: tools
container:
image: image-registry.openshift-image-registry.svc:5000/openshift/udi-rhel9:latest
env:
- name: PORT
value: '8080'
endpoints:
- exposure: none
name: debug
protocol: tcp
targetPort: 9229
- exposure: public
name: transact-chain
protocol: http
targetPort: 8080
volumeMounts:
- name: npm-cache
path: /home/user/.npm
cpuLimit: '2'
cpuRequest: '500m'
memoryLimit: '4Gi'
memoryRequest: '2Gi'
mountSources: true
- name: npm-cache
volume:
size: 1G
commands:
- id: build-and-deploy-to-openshift
exec:
label: "1. Build and deploy to OpenShift using deploy.sh"
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: bash ./deploy.sh
group:
kind: run
isDefault: true
- id: send-sample-cloudevent
exec:
label: "2. Send sample CloudEvent to start the transaction chain"
component: tools
commandLine: |
oc exec -it curler -- curl -v \
http://broker-ingress.knative-eventing.svc.cluster.local/$(oc project -q)/default \
-H "Ce-Id: txn-001" \
-H "Ce-Specversion: 1.0" \
-H "Ce-Type: defaultChain" \
-H "Ce-Source: devfile" \
-H "Content-Type: application/json" \
-d '{"transactionId":"txn-001","customerId":"12345","amount":2500,"currency":"USD"}'
workingDir: ${PROJECT_SOURCE}
group:
kind: build
- id: follow-knative-logs
exec:
label: "3. Follow Knative service logs"
component: tools
commandLine: >
oc logs -l serving.knative.dev/service=transaction-chain -f
workingDir: ${PROJECT_SOURCE}
group:
kind: build
- id: open-kafka-ui
exec:
label: "4. Open Kafka UI tool (copy link below)"
component: tools
commandLine: >
echo "👉 Open this in your browser: https://kafka-ui-workshop-kafka.apps.<cluster-domain>"
workingDir: ${PROJECT_SOURCE}
group:
kind: run