Triggers and Templates Catalog

Triggers

NAMEDESCRIPTIONTEMPLATE
on-createdApplication is created.app-created
on-deletedApplication is deleted.app-deleted
on-deployedApplication is synced and healthy. Triggered once per commit.app-deployed
on-health-degradedApplication has degradedapp-health-degraded
on-sync-failedApplication syncing has failedapp-sync-failed
on-sync-runningApplication is being syncedapp-sync-running
on-sync-status-unknownApplication status is ‘Unknown’app-sync-status-unknown
on-sync-succeededApplication syncing has succeededapp-sync-succeeded

Templates

app-created

definition:

  1. email:
  2. subject: Application {{.app.metadata.name}} has been created.
  3. message: Application {{.app.metadata.name}} has been created.
  4. teams:
  5. title: Application {{.app.metadata.name}} has been created.

app-deleted

definition:

  1. email:
  2. subject: Application {{.app.metadata.name}} has been deleted.
  3. message: Application {{.app.metadata.name}} has been deleted.
  4. teams:
  5. title: Application {{.app.metadata.name}} has been deleted.

app-deployed

definition:

  1. email:
  2. subject: New version of an application {{.app.metadata.name}} is up and running.
  3. message: |
  4. {{if eq .serviceType "slack"}}:white_check_mark:{{end}} Application {{.app.metadata.name}} is now running new version of deployments manifests.
  5. slack:
  6. attachments: |
  7. [{
  8. "title": "{{ .app.metadata.name}}",
  9. "title_link":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
  10. "color": "#18be52",
  11. "fields": [
  12. {
  13. "title": "Sync Status",
  14. "value": "{{.app.status.sync.status}}",
  15. "short": true
  16. },
  17. {
  18. "title": "Repository",
  19. "value": "{{.app.spec.source.repoURL}}",
  20. "short": true
  21. },
  22. {
  23. "title": "Revision",
  24. "value": "{{.app.status.sync.revision}}",
  25. "short": true
  26. }
  27. {{range $index, $c := .app.status.conditions}}
  28. {{if not $index}},{{end}}
  29. {{if $index}},{{end}}
  30. {
  31. "title": "{{$c.type}}",
  32. "value": "{{$c.message}}",
  33. "short": true
  34. }
  35. {{end}}
  36. ]
  37. }]
  38. deliveryPolicy: Post
  39. groupingKey: ""
  40. notifyBroadcast: false
  41. teams:
  42. facts: |
  43. [{
  44. "name": "Sync Status",
  45. "value": "{{.app.status.sync.status}}"
  46. },
  47. {
  48. "name": "Repository",
  49. "value": "{{.app.spec.source.repoURL}}"
  50. },
  51. {
  52. "name": "Revision",
  53. "value": "{{.app.status.sync.revision}}"
  54. }
  55. {{range $index, $c := .app.status.conditions}}
  56. {{if not $index}},{{end}}
  57. {{if $index}},{{end}}
  58. {
  59. "name": "{{$c.type}}",
  60. "value": "{{$c.message}}"
  61. }
  62. {{end}}
  63. ]
  64. potentialAction: |-
  65. [{
  66. "@type":"OpenUri",
  67. "name":"Operation Application",
  68. "targets":[{
  69. "os":"default",
  70. "uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}"
  71. }]
  72. },
  73. {
  74. "@type":"OpenUri",
  75. "name":"Open Repository",
  76. "targets":[{
  77. "os":"default",
  78. "uri":"{{.app.spec.source.repoURL | call .repo.RepoURLToHTTPS}}"
  79. }]
  80. }]
  81. themeColor: '#000080'
  82. title: New version of an application {{.app.metadata.name}} is up and running.

app-health-degraded

definition:

  1. email:
  2. subject: Application {{.app.metadata.name}} has degraded.
  3. message: |
  4. {{if eq .serviceType "slack"}}:exclamation:{{end}} Application {{.app.metadata.name}} has degraded.
  5. Application details: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}.
  6. slack:
  7. attachments: |
  8. [{
  9. "title": "{{ .app.metadata.name}}",
  10. "title_link": "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
  11. "color": "#f4c030",
  12. "fields": [
  13. {
  14. "title": "Health Status",
  15. "value": "{{.app.status.health.status}}",
  16. "short": true
  17. },
  18. {
  19. "title": "Repository",
  20. "value": "{{.app.spec.source.repoURL}}",
  21. "short": true
  22. }
  23. {{range $index, $c := .app.status.conditions}}
  24. {{if not $index}},{{end}}
  25. {{if $index}},{{end}}
  26. {
  27. "title": "{{$c.type}}",
  28. "value": "{{$c.message}}",
  29. "short": true
  30. }
  31. {{end}}
  32. ]
  33. }]
  34. deliveryPolicy: Post
  35. groupingKey: ""
  36. notifyBroadcast: false
  37. teams:
  38. facts: |
  39. [{
  40. "name": "Health Status",
  41. "value": "{{.app.status.health.status}}"
  42. },
  43. {
  44. "name": "Repository",
  45. "value": "{{.app.spec.source.repoURL}}"
  46. }
  47. {{range $index, $c := .app.status.conditions}}
  48. {{if not $index}},{{end}}
  49. {{if $index}},{{end}}
  50. {
  51. "name": "{{$c.type}}",
  52. "value": "{{$c.message}}"
  53. }
  54. {{end}}
  55. ]
  56. potentialAction: |
  57. [{
  58. "@type":"OpenUri",
  59. "name":"Open Application",
  60. "targets":[{
  61. "os":"default",
  62. "uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}"
  63. }]
  64. },
  65. {
  66. "@type":"OpenUri",
  67. "name":"Open Repository",
  68. "targets":[{
  69. "os":"default",
  70. "uri":"{{.app.spec.source.repoURL | call .repo.RepoURLToHTTPS}}"
  71. }]
  72. }]
  73. themeColor: '#FF0000'
  74. title: Application {{.app.metadata.name}} has degraded.

app-sync-failed

definition:

  1. email:
  2. subject: Failed to sync application {{.app.metadata.name}}.
  3. message: |
  4. {{if eq .serviceType "slack"}}:exclamation:{{end}} The sync operation of application {{.app.metadata.name}} has failed at {{.app.status.operationState.finishedAt}} with the following error: {{.app.status.operationState.message}}
  5. Sync operation details are available at: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true .
  6. slack:
  7. attachments: |
  8. [{
  9. "title": "{{ .app.metadata.name}}",
  10. "title_link":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
  11. "color": "#E96D76",
  12. "fields": [
  13. {
  14. "title": "Sync Status",
  15. "value": "{{.app.status.sync.status}}",
  16. "short": true
  17. },
  18. {
  19. "title": "Repository",
  20. "value": "{{.app.spec.source.repoURL}}",
  21. "short": true
  22. }
  23. {{range $index, $c := .app.status.conditions}}
  24. {{if not $index}},{{end}}
  25. {{if $index}},{{end}}
  26. {
  27. "title": "{{$c.type}}",
  28. "value": "{{$c.message}}",
  29. "short": true
  30. }
  31. {{end}}
  32. ]
  33. }]
  34. deliveryPolicy: Post
  35. groupingKey: ""
  36. notifyBroadcast: false
  37. teams:
  38. facts: |
  39. [{
  40. "name": "Sync Status",
  41. "value": "{{.app.status.sync.status}}"
  42. },
  43. {
  44. "name": "Failed at",
  45. "value": "{{.app.status.operationState.finishedAt}}"
  46. },
  47. {
  48. "name": "Repository",
  49. "value": "{{.app.spec.source.repoURL}}"
  50. }
  51. {{range $index, $c := .app.status.conditions}}
  52. {{if not $index}},{{end}}
  53. {{if $index}},{{end}}
  54. {
  55. "name": "{{$c.type}}",
  56. "value": "{{$c.message}}"
  57. }
  58. {{end}}
  59. ]
  60. potentialAction: |-
  61. [{
  62. "@type":"OpenUri",
  63. "name":"Open Operation",
  64. "targets":[{
  65. "os":"default",
  66. "uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true"
  67. }]
  68. },
  69. {
  70. "@type":"OpenUri",
  71. "name":"Open Repository",
  72. "targets":[{
  73. "os":"default",
  74. "uri":"{{.app.spec.source.repoURL | call .repo.RepoURLToHTTPS}}"
  75. }]
  76. }]
  77. themeColor: '#FF0000'
  78. title: Failed to sync application {{.app.metadata.name}}.

app-sync-running

definition:

  1. email:
  2. subject: Start syncing application {{.app.metadata.name}}.
  3. message: |
  4. The sync operation of application {{.app.metadata.name}} has started at {{.app.status.operationState.startedAt}}.
  5. Sync operation details are available at: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true .
  6. slack:
  7. attachments: |
  8. [{
  9. "title": "{{ .app.metadata.name}}",
  10. "title_link":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
  11. "color": "#0DADEA",
  12. "fields": [
  13. {
  14. "title": "Sync Status",
  15. "value": "{{.app.status.sync.status}}",
  16. "short": true
  17. },
  18. {
  19. "title": "Repository",
  20. "value": "{{.app.spec.source.repoURL}}",
  21. "short": true
  22. }
  23. {{range $index, $c := .app.status.conditions}}
  24. {{if not $index}},{{end}}
  25. {{if $index}},{{end}}
  26. {
  27. "title": "{{$c.type}}",
  28. "value": "{{$c.message}}",
  29. "short": true
  30. }
  31. {{end}}
  32. ]
  33. }]
  34. deliveryPolicy: Post
  35. groupingKey: ""
  36. notifyBroadcast: false
  37. teams:
  38. facts: |
  39. [{
  40. "name": "Sync Status",
  41. "value": "{{.app.status.sync.status}}"
  42. },
  43. {
  44. "name": "Started at",
  45. "value": "{{.app.status.operationState.startedAt}}"
  46. },
  47. {
  48. "name": "Repository",
  49. "value": "{{.app.spec.source.repoURL}}"
  50. }
  51. {{range $index, $c := .app.status.conditions}}
  52. {{if not $index}},{{end}}
  53. {{if $index}},{{end}}
  54. {
  55. "name": "{{$c.type}}",
  56. "value": "{{$c.message}}"
  57. }
  58. {{end}}
  59. ]
  60. potentialAction: |-
  61. [{
  62. "@type":"OpenUri",
  63. "name":"Open Operation",
  64. "targets":[{
  65. "os":"default",
  66. "uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true"
  67. }]
  68. },
  69. {
  70. "@type":"OpenUri",
  71. "name":"Open Repository",
  72. "targets":[{
  73. "os":"default",
  74. "uri":"{{.app.spec.source.repoURL | call .repo.RepoURLToHTTPS}}"
  75. }]
  76. }]
  77. title: Start syncing application {{.app.metadata.name}}.

app-sync-status-unknown

definition:

  1. email:
  2. subject: Application {{.app.metadata.name}} sync status is 'Unknown'
  3. message: |
  4. {{if eq .serviceType "slack"}}:exclamation:{{end}} Application {{.app.metadata.name}} sync is 'Unknown'.
  5. Application details: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}.
  6. {{if ne .serviceType "slack"}}
  7. {{range $c := .app.status.conditions}}
  8. * {{$c.message}}
  9. {{end}}
  10. {{end}}
  11. slack:
  12. attachments: |
  13. [{
  14. "title": "{{ .app.metadata.name}}",
  15. "title_link":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
  16. "color": "#E96D76",
  17. "fields": [
  18. {
  19. "title": "Sync Status",
  20. "value": "{{.app.status.sync.status}}",
  21. "short": true
  22. },
  23. {
  24. "title": "Repository",
  25. "value": "{{.app.spec.source.repoURL}}",
  26. "short": true
  27. }
  28. {{range $index, $c := .app.status.conditions}}
  29. {{if not $index}},{{end}}
  30. {{if $index}},{{end}}
  31. {
  32. "title": "{{$c.type}}",
  33. "value": "{{$c.message}}",
  34. "short": true
  35. }
  36. {{end}}
  37. ]
  38. }]
  39. deliveryPolicy: Post
  40. groupingKey: ""
  41. notifyBroadcast: false
  42. teams:
  43. facts: |
  44. [{
  45. "name": "Sync Status",
  46. "value": "{{.app.status.sync.status}}"
  47. },
  48. {
  49. "name": "Repository",
  50. "value": "{{.app.spec.source.repoURL}}"
  51. }
  52. {{range $index, $c := .app.status.conditions}}
  53. {{if not $index}},{{end}}
  54. {{if $index}},{{end}}
  55. {
  56. "name": "{{$c.type}}",
  57. "value": "{{$c.message}}"
  58. }
  59. {{end}}
  60. ]
  61. potentialAction: |-
  62. [{
  63. "@type":"OpenUri",
  64. "name":"Open Application",
  65. "targets":[{
  66. "os":"default",
  67. "uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}"
  68. }]
  69. },
  70. {
  71. "@type":"OpenUri",
  72. "name":"Open Repository",
  73. "targets":[{
  74. "os":"default",
  75. "uri":"{{.app.spec.source.repoURL | call .repo.RepoURLToHTTPS}}"
  76. }]
  77. }]
  78. title: Application {{.app.metadata.name}} sync status is 'Unknown'

app-sync-succeeded

definition:

  1. email:
  2. subject: Application {{.app.metadata.name}} has been successfully synced.
  3. message: |
  4. {{if eq .serviceType "slack"}}:white_check_mark:{{end}} Application {{.app.metadata.name}} has been successfully synced at {{.app.status.operationState.finishedAt}}.
  5. Sync operation details are available at: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true .
  6. slack:
  7. attachments: |
  8. [{
  9. "title": "{{ .app.metadata.name}}",
  10. "title_link":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
  11. "color": "#18be52",
  12. "fields": [
  13. {
  14. "title": "Sync Status",
  15. "value": "{{.app.status.sync.status}}",
  16. "short": true
  17. },
  18. {
  19. "title": "Repository",
  20. "value": "{{.app.spec.source.repoURL}}",
  21. "short": true
  22. }
  23. {{range $index, $c := .app.status.conditions}}
  24. {{if not $index}},{{end}}
  25. {{if $index}},{{end}}
  26. {
  27. "title": "{{$c.type}}",
  28. "value": "{{$c.message}}",
  29. "short": true
  30. }
  31. {{end}}
  32. ]
  33. }]
  34. deliveryPolicy: Post
  35. groupingKey: ""
  36. notifyBroadcast: false
  37. teams:
  38. facts: |
  39. [{
  40. "name": "Sync Status",
  41. "value": "{{.app.status.sync.status}}"
  42. },
  43. {
  44. "name": "Synced at",
  45. "value": "{{.app.status.operationState.finishedAt}}"
  46. },
  47. {
  48. "name": "Repository",
  49. "value": "{{.app.spec.source.repoURL}}"
  50. }
  51. {{range $index, $c := .app.status.conditions}}
  52. {{if not $index}},{{end}}
  53. {{if $index}},{{end}}
  54. {
  55. "name": "{{$c.type}}",
  56. "value": "{{$c.message}}"
  57. }
  58. {{end}}
  59. ]
  60. potentialAction: |-
  61. [{
  62. "@type":"OpenUri",
  63. "name":"Operation Details",
  64. "targets":[{
  65. "os":"default",
  66. "uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true"
  67. }]
  68. },
  69. {
  70. "@type":"OpenUri",
  71. "name":"Open Repository",
  72. "targets":[{
  73. "os":"default",
  74. "uri":"{{.app.spec.source.repoURL | call .repo.RepoURLToHTTPS}}"
  75. }]
  76. }]
  77. themeColor: '#000080'
  78. title: Application {{.app.metadata.name}} has been successfully synced