From 8cfd4876764246e4f37d1443be0c91215abc6eea Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Mon, 29 Apr 2019 12:29:51 -0700 Subject: [PATCH] Adds hook weight example --- pre-post-sync/kustomization.yaml | 3 +++ pre-post-sync/sync-job-1.yaml | 17 +++++++++++++++++ pre-post-sync/sync-job-2.yaml | 17 +++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 pre-post-sync/sync-job-1.yaml create mode 100644 pre-post-sync/sync-job-2.yaml diff --git a/pre-post-sync/kustomization.yaml b/pre-post-sync/kustomization.yaml index 35f8f92..9d66997 100644 --- a/pre-post-sync/kustomization.yaml +++ b/pre-post-sync/kustomization.yaml @@ -4,4 +4,7 @@ resources: - ../guestbook/guestbook-ui-deployment.yaml - ../guestbook/guestbook-ui-svc.yaml - pre-sync-job.yaml +# Note that they are out of order here. +- sync-job-2.yaml +- sync-job-1.yaml - post-sync-job.yaml diff --git a/pre-post-sync/sync-job-1.yaml b/pre-post-sync/sync-job-1.yaml new file mode 100644 index 0000000..b9e7e09 --- /dev/null +++ b/pre-post-sync/sync-job-1.yaml @@ -0,0 +1,17 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: after + annotations: + argocd.argoproj.io/hook: Sync + argocd.argoproj.io/hook-weight: 1 + argocd.argoproj.io/hook-delete-policy: HookSucceeded +spec: + template: + spec: + containers: + - name: sleep + image: alpine:latest + command: ["sh", "-c" "echo 1 && sleep 10"] + restartPolicy: Never + backoffLimit: 0 diff --git a/pre-post-sync/sync-job-2.yaml b/pre-post-sync/sync-job-2.yaml new file mode 100644 index 0000000..f773081 --- /dev/null +++ b/pre-post-sync/sync-job-2.yaml @@ -0,0 +1,17 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: after + annotations: + argocd.argoproj.io/hook: Sync + argocd.argoproj.io/hook-weight: 2 + argocd.argoproj.io/hook-delete-policy: HookSucceeded +spec: + template: + spec: + containers: + - name: sleep + image: alpine:latest + command: ["sh", "-c" "echo 2 && sleep 10"] + restartPolicy: Never + backoffLimit: 0