From 1e663bbf3c32470a3022dc60f64ba4f2bd5bbe23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com> Date: Wed, 20 Sep 2023 10:47:30 -0400 Subject: [PATCH] Jenkins: configure for Gerrit Change-Id: Idad10773f064c8e493cd12290925b6a4da958b9b --- Jenkinsfile | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6a41bc1..c089058 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,7 +1,39 @@ pipeline { agent any - + triggers { + gerrit customUrl: '', + gerritProjects: [ + [branches: [[compareType: 'PLAIN', pattern: 'master']], + compareType: 'PLAIN', + disableStrictForbiddenFileVerification: false, + pattern: 'dhtnet']], + triggerOnEvents: [ + commentAddedContains('!build'), + patchsetCreated(excludeDrafts: true, excludeNoCodeChange: true, + excludeTrivialRebase: true)] + } + options { + ansiColor('xterm') + } + parameters { + string(name: 'GERRIT_REFSPEC', + defaultValue: 'refs/heads/dhtnet', + description: 'The Gerrit refspec to fetch.') + } stages { + stage('SCM Checkout') { + steps { + checkout changelog: true, poll: false, + scm: [$class: 'GitSCM', + branches: [[name: 'FETCH_HEAD']], + doGenerateSubmoduleConfigurations: false, + extensions: [ + [$class: 'CloneOption', noTags: true, reference: '', shallow: true], + [$class: 'WipeWorkspace']], + submoduleCfg: [], + userRemoteConfigs: [[refspec: '${GERRIT_REFSPEC}', url: 'https://${JAMI_GERRIT_URL}/dhtnet']]] + } + } stage('Build') { steps { script { -- GitLab