forked from orientechnologies/teleporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
executable file
·49 lines (33 loc) · 1.73 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
#!groovy
node("master") {
properties([[$class : 'BuildDiscarderProperty',
strategy: [$class : 'LogRotator', artifactDaysToKeepStr: '',
artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10']]])
ansiColor('xterm') {
def mvnHome = tool 'mvn'
def mvnJdk8Image = "orientdb/mvn-gradle-zulu-jdk-8"
def containerName = env.JOB_NAME.replaceAll(/\//, "_") +
"_build_${currentBuild.number}"
def appNameLabel = "docker_ci";
def taskLabel = env.JOB_NAME.replaceAll(/\//, "_")
stage('Source checkout') {
checkout scm
}
stage('Run tests on Java8') {
lock("label": "memory", "quantity": 4) {
docker.image("${mvnJdk8Image}").inside("--label collectd_docker_app=${appNameLabel} --label collectd_docker_task=${taskLabel} " +
"--name ${containerName} --memory=4g ${env.VOLUMES}") {
try {
sh "${mvnHome}/bin/mvn --batch-mode -V -U clean install -Dmaven.test.failure.ignore=true -Dsurefire.useFile=false"
slackSend(color: '#00FF00', message: "SUCCESS: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})")
} catch (e) {
currentBuild.result = 'FAILURE'
slackSend(channel: '#jenkins-failures', color: '#FF0000', message: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})\n${e}")
} finally {
junit allowEmptyResults: true, testResults: '**/target/surefire-reports/TEST-*.xml'
}
}
}
}
}
}