i assume this will work, we'll try it for the platform-as-place
All checks were successful
gitea.arg.rip/deployment/pipeline/head This commit looks good

This commit is contained in:
adam 2025-04-26 14:20:24 -04:00
parent a8585ea76d
commit 76e0ddfdbc

View File

@ -111,6 +111,30 @@ pipeline {
}
}
}
stage("tweak Jenkinsfile"){
steps{
withCredentials([sshUserPrivateKey(credentialsId: 'f42347e9-e3b5-44af-a1af-c5e7b9775fee', keyFileVariable: 'PK')]) {
sh """#!/bin/bash
#mkdir -p ~/.ssh
ssh-keyscan -t ed25519 gitea.arg.rip >> ~/.ssh/known_hosts
#cat ~/.ssh/known_hosts
#shit doesn't work. ssh in, git clone, get your shit set up for keys.
git -c core.sshCommand="ssh -i '$PK'\" clone ssh://git@gitea.arg.rip:8022/beefhavers/${videoname}.git
"""
script {
sh """#!/bin/bash
pushd ${videoname}
sed -i 's/MATRIX_ROOMID="todo"/MATRIX_ROOMID="${env.room_id}"/' Jenkinsfile
git add .
git commit -m "matrix room configured in jenkinsfile"
git -c core.sshCommand="ssh -i '${PK}'\" push
"""
}
}
}
}
stage("link gitea webhook"){
steps{
sh """
@ -139,8 +163,17 @@ pipeline {
cat request.json
"""
//delete old
sh """
curl -X 'PATCH' "https://gitea.arg.rip/api/v1/repos/beefhavers/${videoname}/hooks/\$(cat matrixhook.json | jq .[0].id)" \
curl -X 'DELETE' "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}' \
"""
//make a new one
sh """
curl -X 'POST' "https://gitea.arg.rip/api/v1/repos/beefhavers/${videoname}/hooks" \
-H 'accept: application/json' \
-H 'authorization: token ${env.JENKINSONGITEA}' \
-H 'Content-Type: application/json' \