thiDucTran commented on issue #5207:
URL:
https://github.com/apache/incubator-devlake/issues/5207#issuecomment-2071721048
this is what I ended up with..I hope someone else may be can come up with a
better way... for `hash` or commit sha of your app.. it is just a matter of
having the annotation in your defined argocd app....also don't forget to also
add more annotations to subscribe to your defined triggers.... as for devlake
integration or having devlake doing all this... I'm not sure how you would go
about it
```yaml
template.devlake-commit-status: |
webhook:
devlake:
method: POST
path: /api/plugins/webhook/connections/1/deployments
body: |
{
{{if eq .app.status.health.status "Healthy"}} "result":
"SUCCESS"{{end}}
{{if ne .app.status.health.status "Healthy"}} "result":
"FAILURE"{{end}},
"repo_url": "https://yourUrlHere",
"commit_sha": "{{.app.metadata.annotations.hash}}",
"commit_msg": "optional-commit-message",
"start_time": "{{.app.status.operationState.startedAt}}",
"end_time": "{{.app.status.operationState.finishedAt}}",
"environment": "PRODUCTION"
}
trigger.on-deployed: |
- when: app.status.operationState.phase in ['Succeeded'] and
app.status.health.status != ''
send: [devlake-commit-status]
trigger.on-health-degraded: |
- when: app.status.operationState.phase in ['Succeeded'] and
app.status.health.status != ''
send: [devlake-commit-status]
trigger.on-sync-succeeded: |
- when: app.status.operationState.phase in ['Succeeded'] and
app.status.health.status != ''
send: [devlake-commit-status]
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]