-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathJenkinsfile
54 lines (49 loc) · 2.1 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
51
52
53
54
pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr: '30', artifactNumToKeepStr: '3'))
}
triggers {
cron '@midnight'
}
parameters {
string(name: 'engineListUrl',
description: 'Engine to use for build',
defaultValue: 'https://product.ivyteam.io')
}
stages {
stage('build') {
steps {
script {
def random = (new Random()).nextInt(10000000)
def networkName = "build-" + random
def seleniumName = "selenium-" + random
def groupDocker = sh returnStdout:true, script:'getent group docker | cut -d: -f3'
groupDocker = groupDocker.trim();
sh "docker network create ${networkName}"
try {
docker.image("selenium/standalone-firefox:4")
.withRun("-e START_XVFB=false --shm-size=2g --name ${seleniumName} --network ${networkName} -v /var/run/docker.sock:/var/run/docker.sock --group-add ${groupDocker}") {
docker.build('maven').inside("--network ${networkName} -v /var/run/docker.sock:/var/run/docker.sock -e DOCKER_HOST=unix:///var/run/docker.sock --group-add ${groupDocker}") {
maven cmd: "clean install " +
"--settings deploy/single-project-over-http/settings.xml " +
"-Divy.engine.list.url=${params.engineListUrl} " +
"-Divy.engine.version.latest.minor=true " +
"-Dmaven.test.failure.ignore=true " +
"-Dselenide.remote=http://${seleniumName}:4444/wd/hub "
}
}
} finally {
sh "docker network rm ${networkName}"
}
recordIssues tools: [mavenConsole()], qualityGates: [[threshold: 1, type: 'TOTAL']], filters: [
excludeMessage('The system property test.engine.url is configured twice!.*')
]
junit '**/**/target/*-reports/**/*.xml'
archiveArtifacts '**/**/target/testEngineOut.log'
archiveArtifacts '**/**/target/failsafe-reports/**/*'
}
}
}
}
}