Skip to content
Snippets Groups Projects
Commit 005c84d8 authored by Mohammed Ismail's avatar Mohammed Ismail
Browse files

CI: logs added if deployment gets fail

parent e2c1080c
No related branches found
No related tags found
No related merge requests found
...@@ -55,6 +55,7 @@ def dsT_host_ip_addr = "" ...@@ -55,6 +55,7 @@ def dsT_host_ip_addr = ""
// Flags // Flags
def scmEvent = false def scmEvent = false
def upstreamEvent = false def upstreamEvent = false
def deployed = true
// Default tags / branches --> could be passed on by upstream job or by PR content // Default tags / branches --> could be passed on by upstream job or by PR content
def nrfTag = params.nrfTag def nrfTag = params.nrfTag
...@@ -298,6 +299,7 @@ pipeline { ...@@ -298,6 +299,7 @@ pipeline {
unsuccessful { unsuccessful {
script { script {
sh 'echo "DEPLOYMENT: KO" > archives/deployment_status.log' sh 'echo "DEPLOYMENT: KO" > archives/deployment_status.log'
deployed = false
} }
} }
} }
...@@ -365,7 +367,14 @@ pipeline { ...@@ -365,7 +367,14 @@ pipeline {
} }
post { post {
always { always {
script { script {
// Get logs if deployment fail
if (deployed != true) {
sh 'docker logs cicd-oai-nrf > archives/logs/oai_nrf.log'
sh 'docker logs cicd-oai-amf > archives/logs/oai_amf.log'
sh 'docker logs cicd-oai-smf > archives/logs/oai_smf.log'
sh 'docker logs cicd-oai-upf > archives/logs/oai_spgwu.log'
}
// Remove any leftover containers/networks // Remove any leftover containers/networks
sh 'python3 ./ci-scripts/routeCheck.py --mode=Delete --userName=' + dsT_host_user + ' --hostName=' + dsT_host sh 'python3 ./ci-scripts/routeCheck.py --mode=Delete --userName=' + dsT_host_user + ' --hostName=' + dsT_host
dir('ci-scripts/dsTesterDockerCompose') { dir('ci-scripts/dsTesterDockerCompose') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment