-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
50 lines (40 loc) · 1.13 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
50
MAIN_BRANCH="main"
pipeline {
agent {
docker { image 'openjdk:8u342-jdk' }
}
parameters {
string(name: 'branch', defaultValue: params.branch ?: MAIN_BRANCH, description: 'Branch to build', trim: true)
}
options {
buildDiscarder logRotator(artifactNumToKeepStr: '1', numToKeepStr: '3')
disableConcurrentBuilds()
timeout(activity: true, time: 10)
}
environment {
ARTIFACTORY_DEPLOY=credentials('ICM_ARTIFACTORY_JENKINSCI')
MAVEN_OPTS = "-Dmaven.repo.local=/home/jenkins/.m2/repository"
}
stages {
stage('Build') {
steps {
echo 'Building dataverse.'
sh './mvnw package'
}
post {
always {
recordIssues(tools: [mavenConsole(), java()])
}
}
}
stage('Deploy') {
when {
expression { params.branch == MAIN_BRANCH }
}
steps {
echo 'Deploying artifacts.'
sh './mvnw deploy -Pdeploy -s settings.xml'
}
}
}
}