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