An enterprise-grade Java-based, Apache 2.0 licensed Ethereum client https://wiki.hyperledger.org/display/besu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
besu/Jenkinsfile.smoke

116 lines
3.4 KiB

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:11-jdk',
'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-11-0.0.1',
'pegasyseng/jdk:corretto-11-0.0.1',
'pegasyseng/jdk:openjdk-12',
'pegasyseng/jdk:zulu-openjdk-11',
'pegasyseng/jdk:zulu-openjdk-12'
]
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: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