not sure what's wrong with auth token to link webhook, but everything else works
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
159a0027ff
commit
f109faa5db
@ -7,6 +7,7 @@ pipeline {
|
||||
environment {
|
||||
JENKINSONGITEA=credentials('d0e86441-2157-405f-8539-a9a9010c6ecf')
|
||||
JENKINSONMATRIXTOKEN=credentials('17d18fd7-29eb-4957-9532-ce42aaa9b4ec')
|
||||
GITEAONMATRIXTOKEN=credentials('10bc888a-cb19-456e-b793-f85ee465d58e')
|
||||
}
|
||||
|
||||
stages {
|
||||
@ -75,15 +76,43 @@ pipeline {
|
||||
}
|
||||
echo "roomcreationevent:"
|
||||
echo env.roomcreationevent
|
||||
env.room_id = sh(returnStdout: true, script: "${env.roomcreationevent} | jq .room_id").trim()
|
||||
def jsonObj = readJSON text: env.roomcreationevent
|
||||
env.room_id =jsonObj.room_id
|
||||
if(!env.room_id?.trim()){
|
||||
error "couldn't make matrix room, apparently"
|
||||
}
|
||||
|
||||
env.spaceaddevent=sh(returnStdout: true, script: """
|
||||
curl -X 'PUT' 'https://greyn.club:8448/_matrix/client/r0/rooms/!xLgVvcqtVzquTkCQGx:greyn.club/state/m.space.child/${env.room_id}' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: Bearer ${JENKINSONMATRIXTOKEN}' \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{
|
||||
"via": ["greyn.club"]
|
||||
}'
|
||||
""").trim()
|
||||
echo "spaceaddevent:"
|
||||
echo env.spaceaddevent
|
||||
|
||||
env.elevatePrivsEvent=sh(returnStdout: true, script: """
|
||||
curl -X 'PUT' 'https://greyn.club:8448/_matrix/client/v3/rooms/${env.room_id}/state/m.room.power_levels' \
|
||||
-H 'accept: application/json' \
|
||||
-H 'Authorization: Bearer ${JENKINSONMATRIXTOKEN}' \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{
|
||||
"users": {
|
||||
"@adam:greyn.club": 100
|
||||
}
|
||||
}'
|
||||
""").trim()
|
||||
echo "elevatePrivsEvent:"
|
||||
echo env.elevatePrivsEvent
|
||||
}
|
||||
}
|
||||
}
|
||||
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' \
|
||||
@ -98,7 +127,7 @@ pipeline {
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{
|
||||
"active": true,
|
||||
"authorization_header": \$(cat reporesponse.json | jq .[0].authorization_header),
|
||||
"authorization_header": "Bearer ${env.GITEAONMATRIXTOKEN}",
|
||||
"branch_filter": "*",
|
||||
"config": {
|
||||
"content_type": "json",
|
||||
|
Loading…
Reference in New Issue
Block a user