thiDucTran commented on issue #5207:
URL: 
https://github.com/apache/incubator-devlake/issues/5207#issuecomment-2068859721

   this is what I have to far...there is one thing about `commit_sha` and how 
we can pass this info to ArgoCD..can we use some sort of annotation from the 
ArgoCD Application itself? will continue to test
   
   ```yaml```
   apiVersion: v1
   kind: Secret
   metadata:
     name: argocd-notifications-secret
     namespace: default
   stringData:
     devlake-basic-auth: 'foobar'
   type: Opaque
   ---
   # $devlake-basic-auth is from argocd-notifications-secret
   apiVersion: v1
   data:
     context: |
       argocdUrl:
     service.webhook.devlake: |
       url: http://apache-devlake-ui.infra.svc:4000
       headers:
       - name: Authorization
         value: Basic $devlake-basic-auth
   
     template.devlake-commit-status: |
       webhook:
         devlake:
           method: POST
           path: /api/plugins/webhook/connections/1/deployments
           body: |
             {
               {{if eq .app.status.operationState.phase "Running"}} "result": 
"FAILURE"{{end}}
               {{if eq .app.status.operationState.phase "Succeeded"}} "result": 
"SUCCESS"{{end}}
               {{if eq .app.status.operationState.phase "Error"}} "result": 
"FAILURE"{{end}}
               {{if eq .app.status.operationState.phase "Failed"}} "result": 
"FAILURE"{{end}},
               "repo_url": "https://yourURLhere";,
               "commit_sha": "69ba6b8755848540c88577e4a5e23e14a5d63958",
               "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']
         send: [devlake-commit-status]
     trigger.sync-operation-change: |
       - when: app.status.operationState.phase in ['Error', 'Failed']
         send: [devlake-commit-status]
   kind: ConfigMap
   metadata:
     labels:
       app.kubernetes.io/component: notifications-controller
       app.kubernetes.io/instance: argocd
       app.kubernetes.io/managed-by: Helm
       app.kubernetes.io/name: argocd-notifications-controller
       app.kubernetes.io/part-of: argocd
       app.kubernetes.io/version: v2.9.9
       argocd.argoproj.io/instance: argocd
       helm.sh/chart: argo-cd-5.54.0
     name: argocd-notifications-cm
     namespace: default
   ---
   # notice the annotations to subscribe to the webhook notification
   apiVersion: argoproj.io/v1alpha1
   kind: Application
   metadata:
     annotations:
       notifications.argoproj.io/subscribe.on-deployed.devlake: ""
       notifications.argoproj.io/subscribe.sync-operation-change.devlake: ""    
                                                                                
                                                                                
                                                                 name: thi-dora 
                                                                                
                                                                                
                                  namespace: default
   ```                                                                          
                                                                                
                


-- 
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: dev-unsubscr...@devlake.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to