Skip to content

Commit

Permalink
Add slack notification annotations for applications (#29)
Browse files Browse the repository at this point in the history
Signed-off-by: Said Sef <saidsef@gmail.com>

Signed-off-by: Said Sef <saidsef@gmail.com>
  • Loading branch information
saidsef authored Sep 26, 2022
1 parent e345c40 commit 028570b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions charts/applicationset/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: argocd-applicationsets-services
description: A HELM Chart for ArgoCD ApplicationSets for Kubernetes
type: application
version: &version "0.2.7"
version: &version "0.2.8"
appVersion: *version
kubeVersion: ">= 1.23"
home: https://github.com/saidsef/argocd-applicationsets-services
Expand All @@ -23,7 +23,7 @@ sources:
annotations:
artifacthub.io/license: "Apache-2.0"
artifacthub.io/changes: |
- Update docs version
- Add slack notification annotations for applications
artifacthub.io/links: |
- name: README
url: https://raw.githubusercontent.com/saidsef/argocd-applicationsets-services/main/README.md
Expand Down
3 changes: 2 additions & 1 deletion charts/applicationset/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# argocd-applicationsets-services

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

A HELM Chart for ArgoCD ApplicationSets for Kubernetes

Expand Down Expand Up @@ -29,6 +29,7 @@ Kubernetes: `>= 1.23`
| label | string | `"preview"` | GitHub label to filter PRs that you want to target |
| name | string | `"pr-review"` | ApplicationSet name |
| namespace | string | `"argocd"` | Namespace of ArgoCD controller is deployed |
| notificationChannel | string | `"argocd"` | ArgoCD Slack notification channel |
| owner | string | `"saidsef"` | GitHub repo Organization / username |
| path | string | `"deployment"` | Repository path where deployment files are located |
| repos | list | `[{"images":["docker.io/saidsef/node-webserver:{{branch}}"],"name":"node-webserver"},{"name":"alpine-jenkins-dockerfile","path":"deployment/preview"},{"images":["docker.io/saidsef/aws-kinesis-local:{{branch}}"],"name":"aws-kinesis-local"},{"images":["docker.io/saidsef/aws-dynamodb-local:{{branch}}"],"name":"aws-dynamodb-local"},{"name":"tika-document-to-text","path":"deployment/preview"}]` | List of repo names and override images for preview environment to dynamically pass the branch of the pull request head use '{{branch}}' variable see: https://argocd-applicationset.readthedocs.io/en/stable/Generators-Pull-Request/#template |
Expand Down
6 changes: 6 additions & 0 deletions charts/applicationset/templates/applicationsets-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
{{- $dqb := "}}" -}}
{{- $server := .Values.server | squote -}}
{{- $kustomizeEnabled := .Values.kustomize.enabled | default false -}}
{{- $notificationChannel := .Values.notificationChannel -}}

{{- range $repo := .Values.repos }}
---
Expand Down Expand Up @@ -44,7 +45,12 @@ spec:
metadata:
name: '{{ $repo.name }}-{{ $dqf }}branch{{ $dqb }}-{{ $dqf }}number{{ $dqb }}'
annotations:
argocd.argoproj.io/application-set-refresh: "true"
argocd.argoproj.io/head: '{{ $dqf }}head_sha{{ $dqb }}'
notifications.argoproj.io/subscribe.on-deleted.slack: '{{ $notificationChannel }}'
notifications.argoproj.io/subscribe.on-deployed.slack: '{{ $notificationChannel }}'
notifications.argoproj.io/subscribe.on-health-degraded.slack: '{{ $notificationChannel }}'
notifications.argoproj.io/subscribe.on-sync-failed.slack: '{{ $notificationChannel }}'
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
Expand Down
3 changes: 3 additions & 0 deletions charts/applicationset/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ requeueAfterSeconds: 500
# -- ArgoCD server address
server: 'https://kubernetes.default.svc'

# -- ArgoCD Slack notification channel
notificationChannel: 'argocd'

# -- Should kustomize be enabled
kustomize:
enabled: true
Expand Down

0 comments on commit 028570b

Please sign in to comment.