-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
49 lines (43 loc) · 1.59 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
pipeline {
agent {
dockerfile true
}
options {
buildDiscarder(logRotator(numToKeepStr: '30', artifactNumToKeepStr: '5'))
}
triggers {
cron '@midnight'
}
parameters {
choice(name: 'deployProfile',
description: 'Choose where the built plugin should be deployed to',
choices: ['sonatype.snapshots', 'maven.central.release'])
string(name: 'revision',
description: 'Revision for this release, e.g. newest version "1.3.0" revision should be "1" (-> 1.3.1). Note: This is only used for release target!',
defaultValue: '0' )
}
stages {
stage('build') {
steps {
script {
withCredentials([string(credentialsId: 'gpg.password.axonivy', variable: 'GPG_PWD'), file(credentialsId: 'gpg.keystore.axonivy', variable: 'GPG_FILE')]) {
sh "gpg --batch --import ${env.GPG_FILE}"
def phase = env.BRANCH_NAME == 'master' ? 'deploy' : 'verify'
def mavenProps = ""
if (params.deployProfile == 'maven.central.release') {
mavenProps = "-Drevision=${params.revision}"
}
maven cmd: "clean ${phase} " +
"-P ${params.deployProfile} " +
"-Dgpg.passphrase='${env.GPG_PWD}' " +
"${mavenProps}"
}
}
recordIssues tools: [eclipse()], qualityGates: [[threshold: 1, type: 'TOTAL']]
recordIssues tools: [mavenConsole()]
junit testDataPublishers: [[$class: 'StabilityTestDataPublisher']], testResults: '**/target/surefire-reports/**/*.xml'
archiveArtifacts '**/target/*.jar'
}
}
}
}