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
All checks were successful
gitea.arg.rip/deployment/pipeline/head This commit looks good
This commit is contained in:
parent
a8585ea76d
commit
76e0ddfdbc
@ -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"){
|
stage("link gitea webhook"){
|
||||||
steps{
|
steps{
|
||||||
sh """
|
sh """
|
||||||
@ -139,8 +163,17 @@ pipeline {
|
|||||||
|
|
||||||
cat request.json
|
cat request.json
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
//delete old
|
||||||
|
sh """
|
||||||
|
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 """
|
sh """
|
||||||
curl -X 'PATCH' "https://gitea.arg.rip/api/v1/repos/beefhavers/${videoname}/hooks/\$(cat matrixhook.json | jq .[0].id)" \
|
curl -X 'POST' "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}' \
|
||||||
-H 'Content-Type: application/json' \
|
-H 'Content-Type: application/json' \
|
||||||
|
Loading…
Reference in New Issue
Block a user