Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Github integration instructions #306

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 60 additions & 2 deletions docs/services/github.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ kind: ConfigMap
metadata:
name: argocd-notifications-cm
data:
context: |
argocdUrl: <argocd_host_url>
service.github: |
appID: <app-id>
installationID: <installation-id>
Expand All @@ -46,7 +48,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
Expand All @@ -61,12 +63,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}}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why would you take it from operation instead syncResult?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it did not work otherwise with my setup, and I could not tell why ! In my Application manifests, syncResult was missing for some reasons. I double checked this time and I can now find it. What is the difference between both ? Why would this happen ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syncResult exist when sync already finished. It may not exist if application is just created and sync still didnt happen before

status:
state: success
label: "continuous-delivery/{{.app.metadata.name}}"
Expand Down
Loading