Skip to content

Commit

Permalink
feat(hooks): Add ArgoCD hooks similar to Helm (#135)
Browse files Browse the repository at this point in the history
Based on [ArgoCD Hooks](https://argo-cd.readthedocs.io/en/stable/user-guide/helm/#helm-hooks) docs.

Co-authored-by: Marcin Jasion <[email protected]>
  • Loading branch information
mjasion and mjasion authored Jul 24, 2023
1 parent 274b542 commit f63d35b
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/studio/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.2.14
version: 0.2.15

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
2 changes: 1 addition & 1 deletion charts/studio/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# studio

![Version: 0.2.14](https://img.shields.io/badge/Version-0.2.14-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v2.9.1](https://img.shields.io/badge/AppVersion-v2.9.1-informational?style=flat-square)
![Version: 0.2.15](https://img.shields.io/badge/Version-0.2.15-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v2.9.1](https://img.shields.io/badge/AppVersion-v2.9.1-informational?style=flat-square)

A Helm chart for Kubernetes

Expand Down
2 changes: 2 additions & 0 deletions charts/studio/templates/ingress-blobvault.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ metadata:
name: blobvault
annotations:
helm.sh/hook: post-install,post-upgrade
helm.sh/hook-weight: "-1"
argocd.argoproj.io/hook: PostSync
nginx.ingress.kubernetes.io/rewrite-target: /$2
{{- with .Values.global.ingress.annotations }}
{{- toYaml . | nindent 4 }}
Expand Down
2 changes: 2 additions & 0 deletions charts/studio/templates/ingress-studio-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ metadata:
{{- include "studio-ui.labels" . | nindent 4 }}
annotations:
helm.sh/hook: post-install,post-upgrade
helm.sh/hook-weight: "-1"
argocd.argoproj.io/hook: PostSync
{{- if and .Values.global.basePath (not (eq .Values.global.basePath "/")) }}
nginx.ingress.kubernetes.io/rewrite-target: /$1
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions charts/studio/templates/ingress-studio-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ metadata:
{{- include "studio-ui.labels" . | nindent 4 }}
annotations:
helm.sh/hook: post-install,post-upgrade
helm.sh/hook-weight: "-1"
argocd.argoproj.io/hook: PostSync
{{- with .Values.global.ingress.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
Expand Down
2 changes: 2 additions & 0 deletions charts/studio/templates/ingress-studio-webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ metadata:
{{- include "studio-ui.labels" . | nindent 4 }}
annotations:
helm.sh/hook: post-install,post-upgrade
helm.sh/hook-weight: "-1"
argocd.argoproj.io/hook: PostSync
{{- if and .Values.global.basePath (not (eq .Values.global.basePath "/")) }}
nginx.ingress.kubernetes.io/rewrite-target: /$1
{{- end }}
Expand Down
3 changes: 2 additions & 1 deletion charts/studio/templates/secret-studio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ metadata:
name: studio
{{ if (not (hasKey .Values "ci")) }} # Add annotation if we're not in CI execution.
annotations:
"helm.sh/resource-policy": "keep"
helm.sh/resource-policy: "keep"
argocd.argoproj.io/sync-options: Delete=false
{{- end }}
labels:
{{- include "studio.labels" . | nindent 4 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/studio/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
labels:
{{- include "studio.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
helm.sh/hook: test
spec:
containers:
- name: wget
Expand Down

0 comments on commit f63d35b

Please sign in to comment.