-
Notifications
You must be signed in to change notification settings - Fork 6
/
hook-postsync.yaml
47 lines (47 loc) · 1.43 KB
/
hook-postsync.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
apiVersion: batch/v1
kind: Job
metadata:
generateName: sync-completed-
annotations:
argocd.argoproj.io/hook: PostSync
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
spec:
template:
metadata:
labels:
name: sync-completed
spec:
containers:
# trigger post deployment check via Github Action
- name: notify-newman-results
command: [sh]
args:
- "-c"
- "/scripts/set_commit_status.sh success 'ArgoCD sync successful'
&& /scripts/trigger_post_deployment_workflow.sh"
image: badouralix/curl-jq
volumeMounts:
- name: postsync-scripts
mountPath: /scripts/trigger_post_deployment_workflow.sh
subPath: trigger_post_deployment_workflow.sh
- name: postsync-scripts
mountPath: /scripts/set_commit_status.sh
subPath: set_commit_status.sh
env:
- name: GITHUB_TOKEN
valueFrom:
secretKeyRef:
name: github
key: pat
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: false # image runs as root :(
volumes:
- name: postsync-scripts
configMap:
name: postsync-scripts
defaultMode: 0755
- name: shared-data
emptyDir: {}
restartPolicy: Never
backoffLimit: 0