X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=jenkins%2Fci-pipelines%2Fci_stage_3.groovy;h=c203313aee5414477b2f59ec73a3ed2af5ad2ecb;hb=49c463378083dd80e7638c26782fd6d6d7d768fd;hp=e8e6d25d2d414ee94829313ab282ac9b013885ff;hpb=31b27b3fcf85090348d49ce5f134a08a3e4c62e5;p=osm%2Fdevops.git diff --git a/jenkins/ci-pipelines/ci_stage_3.groovy b/jenkins/ci-pipelines/ci_stage_3.groovy index e8e6d25d..c203313a 100644 --- a/jenkins/ci-pipelines/ci_stage_3.groovy +++ b/jenkins/ci-pipelines/ci_stage_3.groovy @@ -418,10 +418,16 @@ node("${params.NODE}") { println("Waiting for VM at ${IP_ADDRESS} to be reachable") alive = false - while (!alive) { - output = sh(returnStdout: true, script: "sleep 1 ; nc -zv ${IP_ADDRESS} 22 2>&1 || true").trim() - println("output is [$output]") - alive = output.contains('succeeded') + timeout(time: 1, unit: 'MINUTES') { + while (!alive) { + output = sh( + returnStatus: true, + script: "ssh -T -i ${SSH_KEY} " + + "-o StrictHostKeyChecking=no " + + "-o UserKnownHostsFile=/dev/null " + + "-o ConnectTimeout=5 ubuntu@${IP_ADDRESS} 'echo Alive'") + alive = (output == 0) + } } println('VM is ready and accepting ssh connections') } // stage("Spawn Remote VM") @@ -605,10 +611,10 @@ EOF""" stage('Publish to Dockerhub') { parallelSteps = [:] for (buildStep in containerList) { - module = buildStep - moduleName = buildStep.toLowerCase() - dockerTag = params.DOCKER_TAG - moduleTag = containerName + def module = buildStep + def moduleName = buildStep.toLowerCase() + def dockerTag = params.DOCKER_TAG + def moduleTag = containerName parallelSteps[module] = { dir("$module") {