projects
/
osm
/
devops.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Redirecting the logs of robot to a file
[osm/devops.git]
/
jenkins
/
ci-pipelines
/
ci_stage_3.groovy
diff --git
a/jenkins/ci-pipelines/ci_stage_3.groovy
b/jenkins/ci-pipelines/ci_stage_3.groovy
index
1e9748b
..
671482c
100644
(file)
--- a/
jenkins/ci-pipelines/ci_stage_3.groovy
+++ b/
jenkins/ci-pipelines/ci_stage_3.groovy
@@
-84,7
+84,7
@@
def run_robot_systest(stackName,tagName,testName,envfile=null,kubeconfig=null,cl
sh(script: "touch ${tempdir}/env")
envfile="${tempdir}/env"
}
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}")
sh "cp ${tempdir}/* ."
outputDirectory = sh(returnStdout: true, script: "pwd").trim()
println ("Present Directory is : ${outputDirectory}")
@@
-101,6
+101,11
@@
def run_robot_systest(stackName,tagName,testName,envfile=null,kubeconfig=null,cl
])
}
])
}
+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'
node("${params.NODE}") {
sh 'env'
@@
-225,7
+230,7
@@
node("${params.NODE}") {
if ( params.DO_BUILD ) {
stage("Build") {
sh "make -C docker clean"
if ( params.DO_BUILD ) {
stage("Build") {
sh "make -C docker clean"
- sh "make -C
-j `nproc` docker
Q= CMD_DOCKER_ARGS= TAG=${container_name} RELEASE=${params.RELEASE} REPOSITORY_BASE=${repo_base_url} REPOSITORY_KEY=${params.REPO_KEY_NAME} REPOSITORY=${params.REPO_DISTRO}"
+ sh "make -C
docker -j `nproc`
Q= CMD_DOCKER_ARGS= TAG=${container_name} RELEASE=${params.RELEASE} REPOSITORY_BASE=${repo_base_url} REPOSITORY_KEY=${params.REPO_KEY_NAME} REPOSITORY=${params.REPO_DISTRO}"
}
}
}
}
@@
-315,7
+320,8
@@
node("${params.NODE}") {
} //else {
run_systest(container_name,container_name,"openstack_stage_4",params.HIVE_VIM_1)
//}
} //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 {
if ( ! currentBuild.result.equals('UNSTABLE') && ! currentBuild.result.equals('FAILURE')) {
stage_archive = keep_artifacts
} else {