almost entirely works
All checks were successful
gitea.arg.rip/deployment/pipeline/head This commit looks good

webhook linking doesn't. don't know why. Oh well.
This commit is contained in:
adam 2025-01-11 11:46:08 -05:00
parent 622e269bd3
commit 6e55bc1ed2

View File

@ -101,7 +101,8 @@ pipeline {
-H 'Content-Type: application/json' \
-d '{
"users": {
"@adam:greyn.club": 100
"@adam:greyn.club": 100,
"@jenkins:greyn.club": 50
}
}'
""").trim()
@ -118,7 +119,10 @@ pipeline {
-H 'authorization: token ${env.JENKINSONGITEA}' \
>reporesponse.json
cat reporesponse.json
cat reporesponse.json
cat reporesponse.json | jq '.[] | select(.type=="matrix")' >matrixhook.json
cat matrixhook.json
"""
sh """
@ -130,13 +134,13 @@ pipeline {
"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 "\\"events\\": \$(cat matrixhook.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)" \
curl -X 'PATCH' "https://gitea.arg.rip/api/v1/repos/beefhavers/${videoname}/hooks/\$(cat matrixhook.json | jq .[0].id)" \
-H 'accept: application/json' \
-H 'authorization: token ${env.JENKINSONGITEA}' \
-H 'Content-Type: application/json' \
@ -144,6 +148,7 @@ pipeline {
rm request.json
rm reporesponse.json
rm matrixhook.json
"""
}
}