Update Jenkinsfile

This commit is contained in:
2025-12-22 12:37:14 +01:00
parent 9b516305ea
commit 577b7e7fb8

17
Jenkinsfile vendored
View File

@@ -2,13 +2,25 @@ pipeline {
agent any agent any
triggers { triggers {
pollSCM('') // Webhook triggert build // Verwijder pollSCM; we gebruiken webhook trigger
// Generic Webhook Trigger handled by Jenkins job config
}
parameters {
// Parameter om de branch te ontvangen van Gitea webhook
string(name: 'ref', defaultValue: 'refs/heads/main', description: 'Git ref from webhook')
} }
stages { stages {
stage('Checkout') { stage('Checkout') {
steps { steps {
checkout scm checkout([$class: 'GitSCM',
branches: [[name: "${params.ref}"]],
userRemoteConfigs: [[
url: 'https://git.de-roo.org/ben/ben.de-roo.org.git',
credentialsId: 'Gitea-PAT-Ben'
]]
])
} }
} }
@@ -19,6 +31,7 @@ pipeline {
rsync -avz --delete \ rsync -avz --delete \
--exclude .git \ --exclude .git \
--exclude Jenkinsfile \ --exclude Jenkinsfile \
-e "ssh -o StrictHostKeyChecking=no" \
./ www-data@web14:/var/www/html/ ./ www-data@web14:/var/www/html/
''' '''
} }