apiVersion: argoproj.io/v1alpha1 kind: Workflow metadata: name: "{{ include "helm-socks-frontend.name" . }}-workflow" annotations: argocd.argoproj.io/hook: PostSync # argocd.argoproj.io/hook-delete-policy: HookSucceeded spec: entrypoint: whalesay onExit: exit-handler # invoke the whalesay template templates: - name: whalesay # name of the template container: image: docker/whalesay command: [cowsay] args: ["hello world"] - name: exit-handler steps: - - name: notify template: send-email - name: celebrate template: celebrate when: "{{ `{{workflow.status}}` }} == Succeeded" - name: cry template: cry when: "{{ `{{workflow.status}}` }} != Succeeded" - name: send-email container: image: alpine:latest command: [sh, -c] args: ["echo send e-mail: {{ `{{workflow.name}} {{workflow.status}}` }}"] - name: celebrate container: image: alpine:latest command: [sh, -c] args: ["echo hooray!"] - name: cry container: image: alpine:latest command: [sh, -c] args: ["echo boohoo!"]