Browse Source

Adds hook weight example

pull/24/head
Alex Collins 6 years ago
parent
commit
8cfd487676
  1. 3
      pre-post-sync/kustomization.yaml
  2. 17
      pre-post-sync/sync-job-1.yaml
  3. 17
      pre-post-sync/sync-job-2.yaml

3
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

17
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

17
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
Loading…
Cancel
Save