github.com/kubevela/workflow@v0.6.0/examples/multiple-apps.md (about) 1 # Control the delivery process of multiple applications 2 3 Apply the following workflow to control the delivery process of multiple applications: 4 5 ```yaml 6 apiVersion: core.oam.dev/v1alpha1 7 kind: WorkflowRun 8 metadata: 9 name: apply-applications 10 namespace: default 11 annotations: 12 workflowrun.oam.dev/debug: "true" 13 spec: 14 workflowSpec: 15 steps: 16 - name: check-app-exist 17 type: read-app 18 properties: 19 name: webservice-app 20 - name: apply-app1 21 type: apply-app 22 if: status["check-app-exist"].message == "Application not found" 23 properties: 24 data: 25 apiVersion: core.oam.dev/v1beta1 26 kind: Application 27 metadata: 28 name: webservice-app 29 spec: 30 components: 31 - name: express-server 32 type: webservice 33 properties: 34 image: crccheck/hello-world 35 ports: 36 - port: 8000 37 - name: suspend 38 type: suspend 39 timeout: 24h 40 - name: apply-app2 41 type: apply-app 42 properties: 43 ref: 44 name: my-app 45 key: application 46 type: configMap 47 --- 48 apiVersion: v1 49 kind: ConfigMap 50 metadata: 51 name: my-app 52 namespace: default 53 data: 54 application: | 55 apiVersion: core.oam.dev/v1beta1 56 kind: Application 57 metadata: 58 name: webservice-app2 59 spec: 60 components: 61 - name: express-server2 62 type: webservice 63 properties: 64 image: crccheck/hello-world 65 ports: 66 - port: 8000 67 ``` 68 69 Above workflow will first try to read the Application called `webservice-app` from the cluster, if the Application is not found, this step's status message will be `Application not found`. The second step will deploy the `webservice-app` Application if `webservice-app` is not exist in the cluster. After that, the `suspend` step will suspend the delivery process for manual approve. 70 71 ``` 72 $ kubectl get wr 73 NAME PHASE AGE 74 apply-applications suspending 2s 75 ``` 76 77 You can use `vela workflow resume` to resume this workflow, note that if the workflow has not been resumed in 24 hours, the workflow will failed of timeout: 78 79 ``` 80 vela workflow resume apply-applications 81 ``` 82 83 After the workflow is resumed, it will deploy an another Application from the data in ConfigMap with key `application`.