progress but still doesn't link webhook
All checks were successful
gitea.arg.rip/deployment/pipeline/head This commit looks good

This commit is contained in:
adam 2025-01-09 17:28:34 -05:00
parent f109faa5db
commit abbff95371

View File

@ -112,29 +112,38 @@ pipeline {
}
stage("link gitea webhook"){
steps{
error "this doesn't work, idk why"
sh """
curl -X 'GET' 'https://gitea.arg.rip/api/v1/repos/beefhavers/${videoname}/hooks' \
-H 'accept: application/json' \
-H 'authorization: token ${env.JENKINSONGITEA}' \
>reporesponse.json
cat reporesponse.json
"""
sh """
curl -X 'PATCH' 'https://gitea.arg.rip/api/v1/repos/beefhavers/${videoname}/hooks' \
-H 'accept: application/json' \
-H 'authorization: token ${env.JENKINSONGITEA}' \
-H 'Content-Type: application/json' \
-d '{
echo '{
"active": true,
"authorization_header": "Bearer ${env.GITEAONMATRIXTOKEN}",
"branch_filter": "*",
"config": {
"content_type": "json",
"url": "https://greyn.club:8448/_matrix/client/r0/rooms/\$(echo ${env.room_id} | sed 's/!/%21/')/send/m.room.message"
},
"events": \$(cat reporesponse.json | jq .[0].events)
}'
"content_type": "json",' >request.json
echo "\\"url\\": \\"https://greyn.club:8448/_matrix/client/r0/rooms/\$(echo ${env.room_id} | sed 's/!/%21/')/send/m.room.message\\"" >>request.json
echo "}," >>request.json
echo "\\"events\\": \$(cat reporesponse.json | jq .[0].events)" >>request.json
echo '}' >>request.json
cat request.json
"""
sh """
curl -X 'PATCH' "https://gitea.arg.rip/api/v1/repos/beefhavers/${videoname}/hooks/\$(cat reporesponse.json | jq .[0].id)" \
-H 'accept: application/json' \
-H 'authorization: token ${env.JENKINSONGITEA}' \
-H 'Content-Type: application/json' \
-d @request.json
rm request.json
rm reporesponse.json
"""
}
}