From b80c5110d34b40988a2b9861f8514c0bb0937e55 Mon Sep 17 00:00:00 2001
From: Benjamin Wingfield <bwingfield@ebi.ac.uk>
Date: Mon, 26 Jun 2023 14:30:44 +0100
Subject: [PATCH] set up callback

---
 data/templates/callback.txt | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/data/templates/callback.txt b/data/templates/callback.txt
index c273beb..495e880 100644
--- a/data/templates/callback.txt
+++ b/data/templates/callback.txt
@@ -7,15 +7,19 @@ callback_exit_handler() \{
   # report the status of the job to the INTERVENE backend
   exit_code=$?
 
-  # todo: don't change the url, change the message content
   if [ $exit_code -eq 0 ]; then
-    url="http://example.com/good/{name}"
+  body='\{"status": "COMPLETED",
+          "pipelineId": "{name}",
+          "outdir": ""}'
   else
-    url="http://example.com/bad/{name}"
+  body='\{"status": "FAILED",
+          "pipelineId": "{name}",
+          "outdir": ""}'
   fi
 
   # do a callback
-  curl -s "$url"
+  url="https://dev.intervenegeneticscores.org/pipeline-manager/pipeline/csc/notify"  
+  curl -X POST -H "Authorization: Bearer $CALLBACK_TOKEN" -d $body $url
 
   exit $exit_code
 }
-- 
GitLab