approve_workflow.yaml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. apiVersion: argoproj.io/v1alpha1
  2. kind: Workflow
  3. metadata:
  4. generateName: front_json-
  5. spec:
  6. entrypoint: front_json-flow
  7. templates:
  8. - name: front_json-flow
  9. dag:
  10. tasks:
  11. - name: A
  12. template: approval
  13. - name: B
  14. template: approval
  15. depends: "A.Succeeded"
  16. when: "{{ tasks.A.outputs.parameters.front_json }} == 通过"
  17. - name: C
  18. template: approval
  19. depends: "A.Succeeded"
  20. when: "{{ tasks.A.outputs.parameters.front_json }} == 通过"
  21. - name: D
  22. template: approval
  23. depends: "B.Succeeded && C.Succeeded"
  24. when: "{{ tasks.B.outputs.parameters.front_json }} == 通过 && {{ tasks.C.outputs.parameters.front_json }} == 通过"
  25. - name: E
  26. template: approval
  27. depends: "B.Succeeded && C.Succeeded"
  28. when: "{{ tasks.B.outputs.parameters.front_json }} == 通过 && {{ tasks.C.outputs.parameters.front_json }} == 通过"
  29. - name: F
  30. template: approval
  31. depends: "D.Succeeded && E.Succeeded"
  32. when: "{{ tasks.D.outputs.parameters.front_json }} == 通过 || {{ tasks.E.outputs.parameters.front_json }} == 通过"
  33. - name: approval
  34. suspend: {}
  35. inputs:
  36. parameters:
  37. - name: front_json
  38. default: '通过'
  39. enum:
  40. - '通过'
  41. - '拒绝'
  42. description: >-
  43. 请选择要执行的操作
  44. outputs:
  45. parameters:
  46. - name: front_json
  47. valueFrom:
  48. supplied: {}