sh(script: "touch ${tempdir}/env")
envfile="${tempdir}/env"
}
- sh "docker run --network net${stackName} --env OSM_HOSTNAME=${stackName}_nbi --env-file ${envfile} -v ${clouds}:/etc/openstack/clouds.yaml -v ${kubeconfig}:/root/.kube/config -v ${tempdir}:/robot-systest/reports opensourcemano/tests:${tagName} -c -t ${testName}"
+ sh "docker run --network net${stackName} --env OSM_HOSTNAME=${stackName}_nbi --env PROMETHEUS_HOSTNAME=${stackName}_prometheus --env-file ${envfile} -v ${clouds}:/etc/openstack/clouds.yaml -v ${kubeconfig}:/root/.kube/config -v ${tempdir}:/robot-systest/reports opensourcemano/tests:${tagName} -c -t ${testName}"
sh "cp ${tempdir}/* ."
outputDirectory = sh(returnStdout: true, script: "pwd").trim()
println ("Present Directory is : ${outputDirectory}")
])
}
+def archive_logs(stackName) {
+ sh "docker service ls |grep \"${stackName}\"| awk '{print \$2}'| xargs -iy docker service logs y --timestamps &> containers_logs.txt"
+ archiveArtifacts artifacts: 'containers_logs.txt'
+}
+
node("${params.NODE}") {
sh 'env'
} //else {
run_systest(container_name,container_name,"openstack_stage_4",params.HIVE_VIM_1)
//}
-
+ // Archive logs to containers_logs.txt
+ archive_logs(container_name)
if ( ! currentBuild.result.equals('UNSTABLE') && ! currentBuild.result.equals('FAILURE')) {
stage_archive = keep_artifacts
} else {