Skip to content

Commit 287aa45

Browse files
committed
DATAES-583 - Introduce Jenkins.
1 parent 14a7ad0 commit 287aa45

File tree

7 files changed

+257
-138
lines changed

7 files changed

+257
-138
lines changed

Jenkinsfile

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
pipeline {
2+
agent none
3+
4+
triggers {
5+
pollSCM 'H/10 * * * *'
6+
upstream(upstreamProjects: "spring-data-commons/master", threshold: hudson.model.Result.SUCCESS)
7+
}
8+
9+
options {
10+
disableConcurrentBuilds()
11+
}
12+
13+
stages {
14+
stage("Test") {
15+
parallel {
16+
stage("test: baseline") {
17+
agent {
18+
docker {
19+
image 'adoptopenjdk/openjdk8:latest'
20+
args '-v $HOME/.m2:/root/.m2'
21+
}
22+
}
23+
steps {
24+
sh "./mvnw clean dependency:list test -Dsort -B"
25+
}
26+
}
27+
}
28+
}
29+
stage('Release to artifactory') {
30+
when {
31+
branch 'issue/*'
32+
}
33+
agent {
34+
docker {
35+
image 'adoptopenjdk/openjdk8:latest'
36+
args '-v $HOME/.m2:/root/.m2'
37+
}
38+
}
39+
40+
environment {
41+
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
42+
}
43+
44+
steps {
45+
sh "USERNAME=${ARTIFACTORY_USR} PASSWORD=${ARTIFACTORY_PSW} ./mvnw -Pci,snapshot -Dmaven.test.skip=true clean deploy -B"
46+
}
47+
}
48+
stage('Release to artifactory with docs') {
49+
when {
50+
branch 'master'
51+
}
52+
agent {
53+
docker {
54+
image 'adoptopenjdk/openjdk8:latest'
55+
args '-v $HOME/.m2:/root/.m2'
56+
}
57+
}
58+
59+
environment {
60+
ARTIFACTORY = credentials('02bd1690-b54f-4c9f-819d-a77cb7a9822c')
61+
}
62+
63+
steps {
64+
sh "USERNAME=${ARTIFACTORY_USR} PASSWORD=${ARTIFACTORY_PSW} ./mvnw -Pci,snapshot -Dmaven.test.skip=true clean deploy -B"
65+
}
66+
}
67+
}
68+
69+
post {
70+
changed {
71+
script {
72+
slackSend(
73+
color: (currentBuild.currentResult == 'SUCCESS') ? 'good' : 'danger',
74+
channel: '#spring-data-dev',
75+
message: "${currentBuild.fullDisplayName} - `${currentBuild.currentResult}`\n${env.BUILD_URL}")
76+
emailext(
77+
subject: "[${currentBuild.fullDisplayName}] ${currentBuild.currentResult}",
78+
mimeType: 'text/html',
79+
recipientProviders: [[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']],
80+
body: "<a href=\"${env.BUILD_URL}\">${currentBuild.fullDisplayName} is reported as ${currentBuild.currentResult}</a>")
81+
}
82+
}
83+
}
84+
}

0 commit comments

Comments
 (0)