[PIE-1500] Get all our smoke tests for all platforms in 1 jenkins job (#1420)

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
pull/2/head
Chris Mckay 6 years ago committed by GitHub
parent 9e6a435a7c
commit aa56b73002
  1. 120
      Jenkinsfile.smoke

@ -0,0 +1,120 @@
def runDocker(image, cmd) {
powershell """
docker run `
--rm `
-w "${env.WORKSPACE}" `
-v "${env.WORKSPACE}:${env.WORKSPACE}:rw" `
-e "WORKSPACE=${env.WORKSPACE}" `
-e "BUILD_NUMBER=${env.BUILD_NUMBER}" `
$image powershell -C "$cmd"
"""
}
def linuxImages = [
'openjdk:8-jdk',
'openjdk:11-jdk',
'openjdk:12-jdk',
'azul/zulu-openjdk:8',
'azul/zulu-openjdk:11',
'azul/zulu-openjdk:12',
'adoptopenjdk/openjdk8-openj9:latest',
'adoptopenjdk/openjdk11-openj9:latest'
]
def createLinuxBuild(dockerImage) {
return {
stage("Smoke ${dockerImage}") {
node {
checkout scm
docker.image(dockerImage).inside {
try {
timeout(30) {
sh './gradlew --no-daemon ' + params.gradle_options + ' build'
}
} finally {
junit testResults: '**/build/test-results/**/*.xml', allowEmptyResults: true
}
}
}
}
}
}
def linuxImagesPrivate = [
'pegasyseng/jdk:oracle-8-0.0.1',
'pegasyseng/jdk:oracle-11-0.0.1',
'pegasyseng/jdk:corretto-8-0.0.1'
]
def createLinuxBuildPrivateImage(dockerImage) {
return {
stage("Smoke ${dockerImage}") {
node {
checkout scm
docker.withRegistry('https://registry.hub.docker.com', 'dockerhub-pegasysengci') {
docker.image(dockerImage).inside {
try {
timeout(30) {
sh './gradlew --no-daemon ' + params.gradle_options + ' build'
}
} finally {
junit testResults: '**/build/test-results/**/*.xml', allowEmptyResults: true
}
}
}
}
}
}
}
def windowsImages = [
"openjdk:8-windowsservercore",
"openjdk:11-windowsservercore",
"openjdk:12-windowsservercore"
]
def createWindowsBuild(dockerImage) {
return {
stage("Smoke ${dockerImage}") {
node("windows-server-2019") {
checkout scm
try {
timeout(30) {
runDocker(
dockerImage,
".\\gradlew --no-daemon " + params.gradle_options + " build"
)
}
} finally {
junit testResults: "**\\build\\test-results\\**\\*.xml", allowEmptyResults: true
}
}
}
}
}
def builds = [:]
if (params.javas != 'all') {
builds = builds + (windowsImages.findAll {it.contains(params.javas)}.collectEntries {
["Smoke ${it}", createWindowsBuild(it)]
})
builds = builds + (linuxImages.findAll {it.contains(params.javas)}.collectEntries {
["Smoke ${it}", createLinuxBuild(it)]
})
builds = builds + (linuxImagesPrivate.findAll {it.contains(params.javas)}.collectEntries {
["Smoke ${it}", createLinuxBuildPrivateImage(it)]
})
} else {
builds = builds + (windowsImages.collectEntries {
["Smoke ${it}", createWindowsBuild(it)]
})
builds = builds + (linuxImages.collectEntries {
["Smoke ${it}", createLinuxBuild(it)]
})
builds = builds + (linuxImagesPrivate.collectEntries {
["Smoke ${it}", createLinuxBuildPrivateImage(it)]
})
}
parallel builds
Loading…
Cancel
Save