From 2e1046267b83a486328fd0405027f8a22d996fc4 Mon Sep 17 00:00:00 2001 From: Ulrich Eckhardt Date: Wed, 9 Feb 2022 21:25:27 +0100 Subject: [PATCH] Jenkinsfile: Rewrite from scratch. --- Jenkinsfile | 37 +++++++++---------------------------- 1 file changed, 9 insertions(+), 28 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ba9a1a35..3c90461b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,31 +1,12 @@ -#!groovy +#!/usr/bin/env groovy +pipeline { + agent any -def deployBranches = [ "master" ] -def phase = "verify" - -stage ('Build') { - node { - checkout scm - def branch = scm.branches[0].name - if (deployBranches.contains(branch)) { - phase = "deploy" - } - echo "Running mvn $phase on branch $branch" - sh 'mkdir -p ~/.gnupg' - withCredentials([ - file(credentialsId: 'gpg-pubring', variable: 'GPG_PUB_RING'), - file(credentialsId: 'gpg-secring', variable: 'GPG_SEC_RING'), - file(credentialsId: 'gradle-settings', variable: 'GRADLE_SETTINGS')]) { - try { - sh "./gradlew $phase -P signing.secretKeyRingFile=$GPG_SEC_RING -P extProps=$GRADLE_SETTINGS" - } finally { - archiveArtifacts 'build/libs/*.jar' - archiveArtifacts 'build/libs/*.asc' - if (phase == 'deploy') archiveArtifacts 'build/poms/*.xml' - if (phase == 'deploy') archiveArtifacts 'build/poms/*.asc' - junit allowEmptyResults: true, testResults: 'build/test-results/test/*.xml' - } + stages { + stage('Test') { + steps { + buildPluginWithGradle + } } - step([$class: 'WsCleanup']) } -} \ No newline at end of file +}