github.com/kubevela/workflow@v0.6.0/examples/workflow-run/apply-applications.yaml (about)

     1  apiVersion: core.oam.dev/v1alpha1
     2  kind: WorkflowRun
     3  metadata:
     4    name: apply-applications
     5    namespace: default
     6    annotations:
     7      workflowrun.oam.dev/debug: "true"
     8  spec:
     9    workflowSpec:
    10      steps:
    11        - name: check-app-exist
    12          type: read-app
    13          properties:
    14            name: webservice-app
    15        - name: apply-app1
    16          type: apply-app
    17          if: status["check-app-exist"].message == "Application not found"
    18          properties:
    19            data:
    20              apiVersion: core.oam.dev/v1beta1
    21              kind: Application
    22              metadata:
    23                name: webservice-app
    24              spec:
    25                components:
    26                  - name: express-server
    27                    type: webservice
    28                    properties:
    29                      image: crccheck/hello-world
    30                      ports:
    31                        - port: 8000
    32        - name: suspend
    33          type: suspend
    34          timeout: 24h
    35        - name: apply-app2
    36          type: apply-app
    37          properties:
    38            ref:
    39              name: my-app
    40              key: application
    41              type: configMap
    42  ---
    43  apiVersion: v1
    44  kind: ConfigMap
    45  metadata:
    46    name: my-app
    47    namespace: default
    48  data:
    49    application: |
    50      apiVersion: core.oam.dev/v1beta1
    51      kind: Application
    52      metadata:
    53        name: webservice-app2
    54      spec:
    55        components:
    56          - name: express-server2
    57            type: webservice
    58            properties:
    59              image: crccheck/hello-world
    60              ports:
    61                - port: 8000
    62