From 15a28dceff0b6f53e0b79188124bd06b1e4e35f2 Mon Sep 17 00:00:00 2001 From: Guillaume VARA Date: Mon, 17 Jun 2024 11:23:01 +0200 Subject: [PATCH 1/2] Update github.md --- docs/services/github.md | 66 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 61 insertions(+), 5 deletions(-) diff --git a/docs/services/github.md b/docs/services/github.md index 4cd25239..9a8ea9f5 100644 --- a/docs/services/github.md +++ b/docs/services/github.md @@ -7,9 +7,7 @@ The GitHub notification service changes commit status using [GitHub Apps](https: - `appID` - the app id - `installationID` - the app installation id - `privateKey` - the app private key -- `enterpriseBaseURL` - optional URL, e.g. https://git.example.com/api/v3 - -> ⚠️ _NOTE:_ Specifying `/api/v3` in the `enterpriseBaseURL` is required until [argoproj/notifications-engine#205](https://github.com/argoproj/notifications-engine/issues/205) is resolved. +- `enterpriseBaseURL` - optional URL, e.g. https://git.example.com/ ## Configuration @@ -28,6 +26,8 @@ kind: ConfigMap metadata: name: argocd-notifications-cm data: + context: | + argocdUrl: service.github: | appID: installationID: @@ -46,7 +46,7 @@ stringData: -----END RSA PRIVATE KEY----- ``` -6. Create subscription for your GitHub integration +6. Create subscription for your GitHub integration. You might want to install pre-configured triggers through https://argo-cd.readthedocs.io/en/stable/operator-manual/notifications/#getting-started. ```yaml apiVersion: argoproj.io/v1alpha1 @@ -61,12 +61,68 @@ metadata: ![](https://user-images.githubusercontent.com/18019529/108520497-168ce180-730e-11eb-93cb-b0b91f99bdc5.png) ```yaml +template.app-sync-succeeded: | + message: | + Application {{.app.metadata.name}} sync succeeded at {{.app.status.operationState.finishedAt}}. + github: + repoURL: "{{.app.spec.source.repoURL}}" + revision: "{{.app.status.operationState.operation.sync.revision}}" + status: + state: success + label: "continuous-delivery/{{.app.metadata.name}}" + targetURL: "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true" + pullRequestComment: + content: | + Sync Succeeded + +template.app-sync-failed: | + message: | + Application {{.app.metadata.name}} sync failed at {{.app.status.operationState.finishedAt}}. + github: + repoURL: "{{.app.spec.source.repoURL}}" + revision: "{{.app.status.operationState.operation.sync.revision}}" + status: + state: failure + label: "continuous-delivery/{{.app.metadata.name}}" + targetURL: "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true" + pullRequestComment: + content: | + Sync Failed + +template.app-sync-running: | + message: | + Application {{.app.metadata.name}} sync started at {{.app.status.operationState.startedAt}}. + github: + repoURL: "{{.app.spec.source.repoURL}}" + revision: "{{.app.status.operationState.operation.sync.revision}}" + status: + state: pending + label: "continuous-delivery/{{.app.metadata.name}}" + targetURL: "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true" + pullRequestComment: + content: | + Sync Running + +template.app-sync-status-unknown: | + message: | + Application {{.app.metadata.name}} sync status is unknown as of {{.app.status.operationState.finishedAt}}. + github: + repoURL: "{{.app.spec.source.repoURL}}" + revision: "{{.app.status.operationState.operation.sync.revision}}" + status: + state: error + label: "continuous-delivery/{{.app.metadata.name}}" + targetURL: "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true" + pullRequestComment: + content: | + Sync Status Unknown + template.app-deployed: | message: | Application {{.app.metadata.name}} is now running new version of deployments manifests. github: repoURLPath: "{{.app.spec.source.repoURL}}" - revisionPath: "{{.app.status.operationState.syncResult.revision}}" + revisionPath: "{{.app.status.operationState.operation.sync.revision}}" status: state: success label: "continuous-delivery/{{.app.metadata.name}}" From 9d9e735808dedecf8dec685b590e1f971ae59c6a Mon Sep 17 00:00:00 2001 From: Guillaume VARA Date: Mon, 17 Jun 2024 11:25:14 +0200 Subject: [PATCH 2/2] Update github.md --- docs/services/github.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/services/github.md b/docs/services/github.md index 9a8ea9f5..466f3ac8 100644 --- a/docs/services/github.md +++ b/docs/services/github.md @@ -7,7 +7,9 @@ The GitHub notification service changes commit status using [GitHub Apps](https: - `appID` - the app id - `installationID` - the app installation id - `privateKey` - the app private key -- `enterpriseBaseURL` - optional URL, e.g. https://git.example.com/ +- `enterpriseBaseURL` - optional URL, e.g. https://git.example.com/api/v3 + +> ⚠️ _NOTE:_ Specifying `/api/v3` in the `enterpriseBaseURL` is required until [argoproj/notifications-engine#205](https://github.com/argoproj/notifications-engine/issues/205) is resolved. ## Configuration