progress but still doesn't link webhook
All checks were successful
gitea.arg.rip/deployment/pipeline/head This commit looks good
All checks were successful
gitea.arg.rip/deployment/pipeline/head This commit looks good
This commit is contained in:
parent
f109faa5db
commit
abbff95371
@ -112,29 +112,38 @@ pipeline {
|
|||||||
}
|
}
|
||||||
stage("link gitea webhook"){
|
stage("link gitea webhook"){
|
||||||
steps{
|
steps{
|
||||||
error "this doesn't work, idk why"
|
|
||||||
sh """
|
sh """
|
||||||
curl -X 'GET' 'https://gitea.arg.rip/api/v1/repos/beefhavers/${videoname}/hooks' \
|
curl -X 'GET' 'https://gitea.arg.rip/api/v1/repos/beefhavers/${videoname}/hooks' \
|
||||||
-H 'accept: application/json' \
|
-H 'accept: application/json' \
|
||||||
-H 'authorization: token ${env.JENKINSONGITEA}' \
|
-H 'authorization: token ${env.JENKINSONGITEA}' \
|
||||||
>reporesponse.json
|
>reporesponse.json
|
||||||
|
|
||||||
|
cat reporesponse.json
|
||||||
"""
|
"""
|
||||||
|
|
||||||
sh """
|
sh """
|
||||||
curl -X 'PATCH' 'https://gitea.arg.rip/api/v1/repos/beefhavers/${videoname}/hooks' \
|
echo '{
|
||||||
-H 'accept: application/json' \
|
|
||||||
-H 'authorization: token ${env.JENKINSONGITEA}' \
|
|
||||||
-H 'Content-Type: application/json' \
|
|
||||||
-d '{
|
|
||||||
"active": true,
|
"active": true,
|
||||||
"authorization_header": "Bearer ${env.GITEAONMATRIXTOKEN}",
|
"authorization_header": "Bearer ${env.GITEAONMATRIXTOKEN}",
|
||||||
"branch_filter": "*",
|
"branch_filter": "*",
|
||||||
"config": {
|
"config": {
|
||||||
"content_type": "json",
|
"content_type": "json",' >request.json
|
||||||
"url": "https://greyn.club:8448/_matrix/client/r0/rooms/\$(echo ${env.room_id} | sed 's/!/%21/')/send/m.room.message"
|
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
|
||||||
"events": \$(cat reporesponse.json | jq .[0].events)
|
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
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user