Created
July 21, 2025 20:13
-
-
Save Sdy603/75c4bff90773c7340b01672eca3cb7b0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: ConfigMap | |
| metadata: | |
| name: argocd-notifications-cm | |
| namespace: argocd | |
| data: | |
| config.yaml: | | |
| templates: | |
| dx-cloud-pipelines: | |
| method: POST | |
| url: https://api.getdx.com/pipelines.run | |
| headers: | |
| Content-Type: application/json | |
| body: | | |
| { | |
| "pipeline_name": "{{ .app.metadata.name }}-{{ .app.metadata.namespace }}", | |
| "pipeline_source": "ArgoCD", | |
| "reference_id": "{{ .app.status.operationState.operation.sync.revision }}-{{ .app.status.operationState.startedAt | date \"Unix\" }}", | |
| "started_at": {{ .app.status.operationState.startedAt | date "Unix" }}, | |
| "finished_at": {{ .app.status.operationState.finishedAt | date "Unix" }}, | |
| "status": "success", | |
| "commit_sha": "{{ .app.status.operationState.operation.sync.revision }}", | |
| "repository": "{{ .app.spec.source.repoURL | replace \"https://github.com/\" \"\" | replace \".git\" \"\" }}", | |
| "source_url": "{{ .context.argocdUrl }}/applications/{{ .app.metadata.name }}", | |
| "metadata": { | |
| "namespace": "{{ .app.metadata.namespace }}", | |
| "environment": "{{ .app.metadata.namespace }}" | |
| } | |
| } | |
| dx-cloud-deployments: | |
| method: POST | |
| url: https://api.getdx.com/deployments | |
| headers: | |
| Content-Type: application/json | |
| body: | | |
| { | |
| "deployed_at": {{ .app.status.operationState.finishedAt | date "Unix" }}, | |
| "service": "{{ .app.metadata.name }}", | |
| "commit_sha": "{{ .app.status.sync.revision }}", | |
| "repository": "{{ .app.spec.source.repoURL | replace \"https://github.com/\" \"\" | replace \".git\" \"\" }}", | |
| "source_url": "{{ .context.argocdUrl }}/applications/{{ .app.metadata.name }}", | |
| "source_name": "ArgoCD", | |
| "metadata": { | |
| "namespace": "{{ .app.metadata.namespace }}", | |
| "environment": "{{ .app.metadata.namespace }}" | |
| } | |
| } | |
| triggers: | |
| - name: on-sync-succeeded | |
| condition: app.status.operationState.phase in ['Succeeded'] | |
| template: [dx-cloud-pipelines, dx-cloud-deployments] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment