diff --git a/buildenv/jenkins/JenkinsfileBase b/buildenv/jenkins/JenkinsfileBase index 4fb124b799..8144ed652c 100644 --- a/buildenv/jenkins/JenkinsfileBase +++ b/buildenv/jenkins/JenkinsfileBase @@ -454,7 +454,7 @@ def setup() { dir( WORKSPACE) { // use sshagent with Jenkins credentials ID for all platforms except zOS // on zOS use the user's ssh key - if (!env.SPEC.startsWith('zos')) { + if (!env.SPEC.startsWith('zos') && !(env.SPEC.contains('alpine-linux') && env.DOCKER_REQUIRED)) { get_sources_with_authentication() } else { get_sources() @@ -553,7 +553,7 @@ def makeCompileTest(){ makeTestCmd = "unset LD_LIBRARY_PATH; $makeTestCmd" } dir('aqa-tests') { - if (!env.SPEC.startsWith('zos')) { + if (!env.SPEC.startsWith('zos') && !(env.SPEC.contains('alpine-linux') && env.DOCKER_REQUIRED)) { sshagent (credentials: ["$params.SSH_AGENT_CREDENTIAL"], ignoreMissing: true) { sh "$makeTestCmd"; } diff --git a/buildenv/jenkins/openjdk_tests b/buildenv/jenkins/openjdk_tests index 5130945331..f2e184f572 100644 --- a/buildenv/jenkins/openjdk_tests +++ b/buildenv/jenkins/openjdk_tests @@ -94,6 +94,7 @@ def PLATFORM_MAP = [ 'x86-64_alpine-linux' : [ 'SPEC' : 'alpine-linux_x86-64', 'LABEL' : 'ci.role.test&&hw.arch.x86&&sw.os.alpine-linux', + 'DockerAgents' : ['default'] ], 'x86-32_linux' : [ 'SPEC' : 'linux_x86', @@ -338,6 +339,14 @@ timestamps{ LABEL += '&&hw.arch.x86' if (!LABEL.contains('&&sw.tool.docker')) { LABEL += '&&sw.tool.docker' + env.DOCKER_REQUIRED = true + } + } + if (dockerAgentLabel.equals('default') && SPEC.equals('alpine-linux_x86-64')) { + LABEL = LABEL.minus("&&sw.os.alpine-linux") + if (!LABEL.contains('&&sw.tool.docker')) { + LABEL += '&&sw.tool.docker' + env.DOCKER_REQUIRED = true } } println "Cannot find any idle nodes. Starting run test on docker node, nodeLabel: '${LABEL}', dockerAgentLabel: '${dockerAgentLabel}'" @@ -449,6 +458,12 @@ def runTest() { // The ${HOME} directory must be mounted, otherwise xvfb will fail to startup docker.image('alibabadragonwell/riscv-normal-qemu_6.0.0-rvv-1.0:latest').inside("-v ${env.HOME}:${env.HOME}") { jenkinsfile.testBuild() + } else if (dockerAgentLabel.equals('default') && LABEL.contains('&&sw.tool.docker') && SPEC.equals('alpine-linux_x86-64')) { + // Dockerfile: https://github.com/dragonwell-releng/aqa-tests-dockerfile/blob/main/alpine-linux_test.Dockerfile + docker.image('alibabadragonwelljdk/alpine_test_image').pull() + docker.image('alibabadragonwelljdk/alpine_test_image').inside("-v ${env.HOME}:${env.HOME} --network host --privileged -v /etc/hosts:/etc/hosts:ro -v /etc/group:/etc/group:ro -v /etc/passwd:/etc/passwd:ro -v /etc/shadow:/etc/shadow:ro") { + jenkinsfile.testBuild() + } } } else { jenkinsfile.testBuild() @@ -611,4 +626,5 @@ def generateJobViaAutoGen(testJobName) { build job: 'Test_Job_Auto_Gen', parameters: jobParams, propagate: true } -} \ No newline at end of file +} +